Peter Collingbourne | 4846675 | 2010-10-24 18:30:18 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -Werror -triple i386-unknown-unknown -emit-llvm -o %t %s |
Daniel Dunbar | 41e11a9 | 2010-09-17 23:21:43 +0000 | [diff] [blame] | 2 | // RUN: FileCheck < %t %s |
| 3 | // |
| 4 | // FIXME: Note that we don't currently get the ABI right here. f0() should be |
| 5 | // f0(i8*). |
| 6 | |
| 7 | typedef union { |
| 8 | void *f0; |
| 9 | } transp_t0 __attribute__((transparent_union)); |
| 10 | |
| 11 | void f0(transp_t0 obj); |
| 12 | |
| 13 | // CHECK: define void @f1_0(i32* %a0) |
| 14 | // CHECK: call void @f0(%union.anon* byval %{{.*}}) |
Peter Collingbourne | 4846675 | 2010-10-24 18:30:18 +0000 | [diff] [blame] | 15 | // CHECK: call void %{{.*}}(i8* %{{[a-z0-9]*}}) |
Daniel Dunbar | 41e11a9 | 2010-09-17 23:21:43 +0000 | [diff] [blame] | 16 | // CHECK: } |
| 17 | void f1_0(int *a0) { |
Peter Collingbourne | 4846675 | 2010-10-24 18:30:18 +0000 | [diff] [blame] | 18 | void (*f0p)(void *) = f0; |
Daniel Dunbar | 41e11a9 | 2010-09-17 23:21:43 +0000 | [diff] [blame] | 19 | f0(a0); |
Peter Collingbourne | 4846675 | 2010-10-24 18:30:18 +0000 | [diff] [blame] | 20 | f0p(a0); |
Daniel Dunbar | 41e11a9 | 2010-09-17 23:21:43 +0000 | [diff] [blame] | 21 | } |
| 22 | |
| 23 | void f1_1(int *a0) { |
| 24 | f0((transp_t0) { a0 }); |
| 25 | } |