1 ; RUN: llc < %s -mtriple=i686-pc-win32 | FileCheck %s
3 define void @test1(i32 %c) {
7 %tobool = icmp eq i32 %c, 0
8 br i1 %tobool, label %if.end, label %if.then
15 call void @crash(ptr %0)
18 ; There is no need to adjust the stack after the call, since
19 ; the function is noreturn and that code will therefore never run.
24 define void @test2(i32 %c) {
27 %0 = alloca i8, i32 %c
28 %tobool = icmp eq i32 %c, 0
29 br i1 %tobool, label %if.end, label %if.then
36 call void @crash2(ptr %0)
38 ; CHECK: calll _crash2
39 ; Even though _crash2 is not marked noreturn, it is in practice because
40 ; of the "unreachable" right after it. This happens e.g. when falling off
41 ; a non-void function after a call.
46 declare void @crash(ptr) noreturn
47 declare void @crash2(ptr)
50 %struct.ByVal = type { [10 x i32] }
52 define dso_local i32 @pr43155() {
54 %agg.tmp = alloca %struct.ByVal, align 4
55 %agg.tmp5 = alloca %struct.ByVal, align 4
56 %agg.tmp6 = alloca %struct.ByVal, align 4
57 %call = tail call i32 @cond()
58 %tobool = icmp eq i32 %call, 0
59 br i1 %tobool, label %if.end, label %if.then
61 if.then: ; preds = %entry
62 tail call x86_stdcallcc void @stdcall_abort(i32 12, i32 2)
65 if.end: ; preds = %entry
66 %call1 = tail call i32 @cond()
67 %tobool2 = icmp eq i32 %call1, 0
68 br i1 %tobool2, label %if.end4, label %if.then3
70 if.then3: ; preds = %if.end
71 tail call x86_stdcallcc void @stdcall_abort(i32 15, i32 2)
74 if.end4: ; preds = %if.end
75 call void @getbyval(ptr nonnull sret(%struct.ByVal) %agg.tmp)
76 call void @make_push_unprofitable(ptr nonnull byval(%struct.ByVal) align 4 %agg.tmp)
77 call void @getbyval(ptr nonnull sret(%struct.ByVal) %agg.tmp5)
78 call void @make_push_unprofitable(ptr nonnull byval(%struct.ByVal) align 4 %agg.tmp5)
79 call void @getbyval(ptr nonnull sret(%struct.ByVal) %agg.tmp6)
80 call void @make_push_unprofitable(ptr nonnull byval(%struct.ByVal) align 4 %agg.tmp6)
84 ; Check that there are no stack adjustments after stdcall_abort.
85 ; CHECK-LABEL: pr43155:
86 ; The main function body contents are not important.
89 ; CHECK: calll _stdcall_abort@8
93 ; CHECK: calll _stdcall_abort@8
96 ; CHECK: # -- End function
98 declare dso_local i32 @cond()
100 declare dso_local x86_stdcallcc void @stdcall_abort(i32, i32) noreturn
102 declare dso_local void @make_push_unprofitable(ptr byval(%struct.ByVal) align 4)
104 declare dso_local void @getbyval(ptr sret(%struct.ByVal))