1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -S -passes='default<O3>' < %s | FileCheck %s --check-prefixes=CHECK,DEFAULT
3 ; RUN: opt -S -passes='lto<O3>' < %s | FileCheck %s --check-prefixes=CHECK,LTO
5 declare void @llvm.trap()
7 define void @do_trap(ptr %ptr) {
8 ; CHECK-LABEL: @do_trap(
9 ; CHECK-NEXT: tail call void @llvm.trap()
10 ; CHECK-NEXT: unreachable
12 call void @llvm.trap()
16 define internal void @capture_and_trap(ptr %ptr) noinline {
17 ; CHECK-LABEL: @capture_and_trap(
18 ; CHECK-NEXT: tail call void @llvm.trap()
19 ; CHECK-NEXT: unreachable
21 %alloca = alloca ptr, align 4
22 store ptr %ptr, ptr %alloca, align 4
23 call void @do_trap(ptr noundef nonnull %alloca)
27 define internal void @dead_fn1() {
31 define internal void @dead_fn2() {
35 define void @test(i1 %c) {
37 ; CHECK-NEXT: tail call fastcc void @capture_and_trap()
38 ; CHECK-NEXT: unreachable
40 br i1 %c, label %if, label %else
43 call void @capture_and_trap(ptr @dead_fn1)
47 call void @capture_and_trap(ptr @dead_fn2)
50 ;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line: