Home | History | Annotate | Download | only in CodeGen
      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 
      7 typedef union {
      8   void *f0;
      9 } transp_t0 __attribute__((transparent_union));
     10 
     11 void f0(transp_t0 obj);
     12 
     13 // CHECK-LABEL: define void @f1_0(i32* %a0)
     14 // CHECK:  call void @f0(i8* %{{.*}})
     15 // CHECK:  call void %{{.*}}(i8* %{{[a-z0-9]*}})
     16 // CHECK: }
     17 
     18 // ARM-LABEL: define arm_aapcscc void @f1_0(i32* %a0)
     19 // ARM:  call arm_aapcscc void @f0(i8* %{{.*}})
     20 // ARM:  call arm_aapcscc void %{{.*}}(i8* %{{[a-z0-9]*}})
     21 // ARM: }
     22 void f1_0(int *a0) {
     23   void (*f0p)(void *) = f0;
     24   f0(a0);
     25   f0p(a0);
     26 }
     27 
     28 void f1_1(int *a0) {
     29   f0((transp_t0) { a0 });
     30 }
     31