1 ; RUN: llc < %s -mtriple=x86_64-linux-gnu | FileCheck %s
3 ; PR43155, we used to emit dead stack adjustments for noreturn calls with stack
6 ; Original source code:
7 ; __attribute__((noreturn)) void exit_manyarg(int, int, int, int, int, int, int, int, int, int);
11 ; struct ByVal getbyval();
12 ; void make_push_unprofitable(struct ByVal);
15 ; exit_manyarg(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
16 ; make_push_unprofitable(getbyval());
17 ; make_push_unprofitable(getbyval());
18 ; make_push_unprofitable(getbyval());
22 %struct.ByVal = type { [10 x i32] }
24 define dso_local i32 @foo(i32 %c) {
26 %agg.tmp = alloca %struct.ByVal, align 8
27 %agg.tmp1 = alloca %struct.ByVal, align 8
28 %agg.tmp2 = alloca %struct.ByVal, align 8
29 %tobool = icmp eq i32 %c, 0
30 br i1 %tobool, label %if.end, label %if.then
32 if.then: ; preds = %entry
33 tail call void @exit_manyarg(i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10) #3
36 if.end: ; preds = %entry
37 call void @getbyval(%struct.ByVal* nonnull sret %agg.tmp) #4
38 call void @make_push_unprofitable(%struct.ByVal* nonnull byval(%struct.ByVal) align 8 %agg.tmp) #4
39 call void @getbyval(%struct.ByVal* nonnull sret %agg.tmp1) #4
40 call void @make_push_unprofitable(%struct.ByVal* nonnull byval(%struct.ByVal) align 8 %agg.tmp1) #4
41 call void @getbyval(%struct.ByVal* nonnull sret %agg.tmp2) #4
42 call void @make_push_unprofitable(%struct.ByVal* nonnull byval(%struct.ByVal) align 8 %agg.tmp2) #4
47 ; The main body is not important.
48 ; CHECK: callq exit_manyarg
51 ; CHECK: # -- End function
53 ; Function Attrs: noreturn
54 declare dso_local void @exit_manyarg(i32, i32, i32, i32, i32, i32, i32, i32, i32, i32) noreturn
56 declare dso_local void @make_push_unprofitable(%struct.ByVal* byval(%struct.ByVal) align 8)
58 declare dso_local void @getbyval(%struct.ByVal* sret)