Mercurial > hg > CbC > CbC_llvm
comparison clang/test/CodeGenCXX/microsoft-abi-byval-vararg.cpp @ 207:2e18cbf3894f
LLVM12
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 08 Jun 2021 06:07:14 +0900 |
parents | 1d019706d866 |
children | c4bab56944e8 |
comparison
equal
deleted
inserted
replaced
173:0572611fdcc8 | 207:2e18cbf3894f |
---|---|
17 sum += va_arg(ap, int); | 17 sum += va_arg(ap, int); |
18 va_end(ap); | 18 va_end(ap); |
19 return sum; | 19 return sum; |
20 } | 20 } |
21 | 21 |
22 // CHECK-LABEL: define dso_local i32 @"?foo@@YAHUA@@ZZ"(<{ %struct.A }>* inalloca %0, ...) | 22 // CHECK-LABEL: define dso_local i32 @"?foo@@YAHUA@@ZZ"(<{ %struct.A }>* inalloca(<{ %struct.A }>) %0, ...) |
23 | 23 |
24 int main() { | 24 int main() { |
25 return foo(A(3), 1, 2, 3); | 25 return foo(A(3), 1, 2, 3); |
26 } | 26 } |
27 // CHECK-LABEL: define dso_local i32 @main() | 27 // CHECK-LABEL: define dso_local i32 @main() |
28 // CHECK: %[[argmem:[^ ]*]] = alloca inalloca <{ %struct.A, i32, i32, i32 }> | 28 // CHECK: %[[argmem:[^ ]*]] = alloca inalloca <{ %struct.A, i32, i32, i32 }> |
29 // CHECK: call i32 {{.*bitcast.*}}@"?foo@@YAHUA@@ZZ"{{.*}}(<{ %struct.A, i32, i32, i32 }>* inalloca %[[argmem]]) | 29 // CHECK: call i32 {{.*bitcast.*}}@"?foo@@YAHUA@@ZZ"{{.*}}(<{ %struct.A, i32, i32, i32 }>* inalloca(<{ %struct.A, i32, i32, i32 }>) %[[argmem]]) |
30 | 30 |
31 void varargs_zero(...); | 31 void varargs_zero(...); |
32 void varargs_one(int, ...); | 32 void varargs_one(int, ...); |
33 void varargs_two(int, int, ...); | 33 void varargs_two(int, int, ...); |
34 void varargs_three(int, int, int, ...); | 34 void varargs_three(int, int, int, ...); |
39 varargs_two(1, 2, x); | 39 varargs_two(1, 2, x); |
40 varargs_three(1, 2, 3, x); | 40 varargs_three(1, 2, 3, x); |
41 } | 41 } |
42 | 42 |
43 // CHECK-LABEL: define dso_local void @"?call_var_args@@YAXXZ"() | 43 // CHECK-LABEL: define dso_local void @"?call_var_args@@YAXXZ"() |
44 // CHECK: call void {{.*bitcast.*varargs_zero.*}}(<{ %struct.A }>* inalloca %{{.*}}) | 44 // CHECK: call void {{.*bitcast.*varargs_zero.*}}(<{ %struct.A }>* inalloca(<{ %struct.A }>) %{{.*}}) |
45 // CHECK: call void {{.*bitcast.*varargs_one.*}}(<{ i32, %struct.A }>* inalloca %{{.*}}) | 45 // CHECK: call void {{.*bitcast.*varargs_one.*}}(<{ i32, %struct.A }>* inalloca(<{ i32, %struct.A }>) %{{.*}}) |
46 // CHECK: call void {{.*bitcast.*varargs_two.*}}(<{ i32, i32, %struct.A }>* inalloca %{{.*}}) | 46 // CHECK: call void {{.*bitcast.*varargs_two.*}}(<{ i32, i32, %struct.A }>* inalloca(<{ i32, i32, %struct.A }>) %{{.*}}) |
47 // CHECK: call void {{.*bitcast.*varargs_three.*}}(<{ i32, i32, i32, %struct.A }>* inalloca %{{.*}}) | 47 // CHECK: call void {{.*bitcast.*varargs_three.*}}(<{ i32, i32, i32, %struct.A }>* inalloca(<{ i32, i32, i32, %struct.A }>) %{{.*}}) |
48 | 48 |
49 // CHECK-LABEL: declare dso_local void @"?varargs_zero@@YAXZZ"(...) | 49 // CHECK-LABEL: declare dso_local void @"?varargs_zero@@YAXZZ"(...) |
50 // CHECK-LABEL: declare dso_local void @"?varargs_one@@YAXHZZ"(i32, ...) | 50 // CHECK-LABEL: declare dso_local void @"?varargs_one@@YAXHZZ"(i32, ...) |
51 // CHECK-LABEL: declare dso_local void @"?varargs_two@@YAXHHZZ"(i32, i32, ...) | 51 // CHECK-LABEL: declare dso_local void @"?varargs_two@@YAXHHZZ"(i32, i32, ...) |
52 // CHECK-LABEL: declare dso_local void @"?varargs_three@@YAXHHHZZ"(i32, i32, i32, ...) | 52 // CHECK-LABEL: declare dso_local void @"?varargs_three@@YAXHHHZZ"(i32, i32, i32, ...) |