diff options
Diffstat (limited to 'clang/test/CodeGen')
-rw-r--r-- | clang/test/CodeGen/complex-indirect.c | 10 | ||||
-rw-r--r-- | clang/test/CodeGen/x86_64-arguments.c | 9 |
2 files changed, 15 insertions, 4 deletions
diff --git a/clang/test/CodeGen/complex-indirect.c b/clang/test/CodeGen/complex-indirect.c index 45eb1954842..0daa970e760 100644 --- a/clang/test/CodeGen/complex-indirect.c +++ b/clang/test/CodeGen/complex-indirect.c @@ -1,10 +1,12 @@ -// RUN: %clang_cc1 -emit-llvm %s -o - -triple=x86_64-apple-darwin10 | FileCheck %s +// RUN: %clang_cc1 -emit-llvm %s -o %t -triple=x86_64-apple-darwin10 +// RUN: FileCheck < %t %s -// Make sure this doesn't crash, and that we don't generate a byval alloca -// with insufficient alignment. +// Make sure this doesn't crash. We used to generate a byval here and wanted to +// verify a valid alignment, but we now realize we can use an i16 and let the +// backend guarantee the alignment. void a(int,int,int,int,int,int,__complex__ char); void b(__complex__ char *y) { a(0,0,0,0,0,0,*y); } // CHECK: define void @b // CHECK: alloca { i8, i8 }*, align 8 -// CHECK: call void @a(i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, { i8, i8 }* byval align 8 +// CHECK: call void @a(i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i16 {{.*}}) diff --git a/clang/test/CodeGen/x86_64-arguments.c b/clang/test/CodeGen/x86_64-arguments.c index 8e7119ef2c9..f73e1f026a8 100644 --- a/clang/test/CodeGen/x86_64-arguments.c +++ b/clang/test/CodeGen/x86_64-arguments.c @@ -345,3 +345,12 @@ void test45() { f45(x45); } typedef float v46 __attribute((vector_size(8))); void f46(v46,v46,v46,v46,v46,v46,v46,v46,v46,v46); void test46() { v46 x = {1,2}; f46(x,x,x,x,x,x,x,x,x,x); } + +// Check that we pass the struct below without using byval, which helps out +// codegen. +// +// CHECK: @test47 +// CHECK: call void @f47(i32 {{.*}}, i32 {{.*}}, i32 {{.*}}, i32 {{.*}}, i32 {{.*}}, i32 {{.*}}, i32 {{.*}}) +struct s47 { unsigned a; }; +void f47(int,int,int,int,int,int,struct s47); +void test47(int a, struct s47 b) { f47(a, a, a, a, a, a, b); } |