From 39fcc9a984e2820e4ea0fa2ac4abd17d9f3a31df Mon Sep 17 00:00:00 2001 From: dim Date: Sun, 20 Feb 2011 13:06:31 +0000 Subject: Vendor import of clang trunk r126079: http://llvm.org/svn/llvm-project/cfe/trunk@126079 --- test/CodeGen/transparent-union.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 test/CodeGen/transparent-union.c (limited to 'test/CodeGen/transparent-union.c') diff --git a/test/CodeGen/transparent-union.c b/test/CodeGen/transparent-union.c new file mode 100644 index 0000000..97a7318 --- /dev/null +++ b/test/CodeGen/transparent-union.c @@ -0,0 +1,25 @@ +// RUN: %clang_cc1 -Werror -triple i386-unknown-unknown -emit-llvm -o %t %s +// RUN: FileCheck < %t %s +// +// FIXME: Note that we don't currently get the ABI right here. f0() should be +// f0(i8*). + +typedef union { + void *f0; +} transp_t0 __attribute__((transparent_union)); + +void f0(transp_t0 obj); + +// CHECK: define void @f1_0(i32* %a0) +// CHECK: call void @f0(%union.transp_t0* byval %{{.*}}) +// CHECK: call void %{{.*}}(i8* %{{[a-z0-9]*}}) +// CHECK: } +void f1_0(int *a0) { + void (*f0p)(void *) = f0; + f0(a0); + f0p(a0); +} + +void f1_1(int *a0) { + f0((transp_t0) { a0 }); +} -- cgit v1.1