| 1 |
// RUN: %clang_cc1 -Werror -triple x86_64-linux -emit-llvm -o - %s | FileCheck %s |
| 2 |
// RUN: %clang_cc1 -Werror -triple i386-linux -emit-llvm -o - %s | FileCheck %s |
| 3 |
// RUN: %clang_cc1 -Werror -triple armv7-linux -emit-llvm -o - %s | FileCheck %s --check-prefix=ARM |
| 4 |
// RUN: %clang_cc1 -Werror -triple powerpc64le-linux -emit-llvm -o - %s | FileCheck %s |
| 5 |
// RUN: %clang_cc1 -Werror -triple aarch64-linux -emit-llvm -o - %s | FileCheck %s |
| 6 |
// RUN: %clang_cc1 -DINFRONT -Werror -triple x86_64-linux -emit-llvm -o - %s | FileCheck %s |
| 7 |
// RUN: %clang_cc1 -DINFRONT -Werror -triple i386-linux -emit-llvm -o - %s | FileCheck %s |
| 8 |
// RUN: %clang_cc1 -DINFRONT -Werror -triple armv7-linux -emit-llvm -o - %s | FileCheck %s --check-prefix=ARM |
| 9 |
// RUN: %clang_cc1 -DINFRONT -Werror -triple powerpc64le-linux -emit-llvm -o - %s | FileCheck %s |
| 10 |
// RUN: %clang_cc1 -DINFRONT -Werror -triple aarch64-linux -emit-llvm -o - %s | FileCheck %s |
| 11 |
|
| 12 |
#ifdef INFRONT |
| 13 |
typedef union __attribute__((transparent_union)) { |
| 14 |
void *f0; |
| 15 |
} transp_t0; |
| 16 |
#else |
| 17 |
typedef union { |
| 18 |
void *f0; |
| 19 |
} transp_t0 __attribute__((transparent_union)); |
| 20 |
#endif |
| 21 |
|
| 22 |
void f0(transp_t0 obj); |
| 23 |
|
| 24 |
// CHECK-LABEL: define{{.*}} void @f1_0(ptr noundef %a0) |
| 25 |
// CHECK: call void @f0(ptr %{{.*}}) |
| 26 |
// CHECK: call void %{{.*}}(ptr noundef %{{[a-z0-9]*}}) |
| 27 |
// CHECK: } |
| 28 |
|
| 29 |
// ARM-LABEL: define{{.*}} arm_aapcscc void @f1_0(ptr noundef %a0) |
| 30 |
// ARM: call arm_aapcscc void @f0(ptr %{{.*}}) |
| 31 |
// ARM: call arm_aapcscc void %{{.*}}(ptr noundef %{{[a-z0-9]*}}) |
| 32 |
// ARM: } |
| 33 |
void f1_0(int *a0) { |
| 34 |
void (*f0p)(void *) = f0; |
| 35 |
f0(a0); |
| 36 |
f0p(a0); |
| 37 |
} |
| 38 |
|
| 39 |
void f1_1(int *a0) { |
| 40 |
f0((transp_t0) { a0 }); |
| 41 |
} |