1 ; RUN: opt < %s -simplifycfg -S | FileCheck %s
4 declare void @Finisher(i32) noreturn
6 ; Make sure we optimize a sequence of two calls (second unreachable);
7 define void @double_call(i32) {
8 ; CHECK-LABEL: @double_call(
9 ; CHECK-NEXT: tail call void @Finisher(i32 %0) #0
10 ; CHECK-NEXT: unreachable
12 tail call void @Finisher(i32 %0) noreturn
13 tail call void @Finisher(i32 %0) noreturn
17 ; Make sure we DON'T try to optimize a musttail call (the IR invariant
18 ; is that it must be followed by [optional bitcast then] ret).
19 define void @must_tail(i32) {
20 ; CHECK-LABEL: @must_tail(
21 ; CHECK-NEXT: musttail call void @Finisher(i32 %0) #0
22 ; CHECK-NEXT: ret void
24 musttail call void @Finisher(i32 %0) #0
28 ; CHECK: attributes #0 = { noreturn }
29 attributes #0 = { noreturn }