Home | History | Annotate | Download | only in CodeGen
      1 // RUN: %clang_cc1 -fno-builtin -emit-llvm -o - %s -triple i386-unknown-unknown | FileCheck -check-prefix CHECK-YES %s
      2 // RUN: %clang_cc1 -fno-builtin-crealf -fno-builtin-creal -fno-builtin-creall \
      3 // RUN:  -fno-builtin-cimagf  -fno-builtin-cimag -fno-builtin-cimagl -emit-llvm \
      4 // RUN:  -o - %s -triple i386-unknown-unknown | FileCheck -check-prefix CHECK-YES %s
      5 // RUN: %clang_cc1 -emit-llvm -o - %s -triple i386-unknown-unknown | FileCheck -check-prefix CHECK-NO %s
      6 
      7 extern float crealf(float _Complex);
      8 extern double creal(double _Complex);
      9 extern long double creall(long double _Complex);
     10 
     11 extern float cimagf(float _Complex);
     12 extern double cimag(double _Complex);
     13 extern long double cimagl(long double _Complex);
     14 
     15 double test_creal(double _Complex z) {
     16   return creal(z);
     17   // CHECK-NO-NOT: call double @creal
     18   // CHECK-YES: call double @creal
     19 }
     20 
     21 long double test_creall(double _Complex z) {
     22   return creall(z);
     23   // CHECK-NO-NOT: call x86_fp80 @creall
     24   // CHECK-YES: call x86_fp80 @creall
     25 }
     26 
     27 float test_crealf(double _Complex z) {
     28   return crealf(z);
     29   // CHECK-NO-NOT: call float @crealf
     30   // CHECK-YES: call float @crealf
     31 }
     32 
     33 double test_cimag(double _Complex z) {
     34   return cimag(z);
     35   // CHECK-NO-NOT: call double @cimag
     36   // CHECK-YES: call double @cimag
     37 }
     38 
     39 long double test_cimagl(double _Complex z) {
     40   return cimagl(z);
     41   // CHECK-NO-NOT: call x86_fp80 @cimagl
     42   // CHECK-YES: call x86_fp80 @cimagl
     43 }
     44 
     45 float test_cimagf(double _Complex z) {
     46   return cimagf(z);
     47   // CHECK-NO-NOT: call float @cimagf
     48   // CHECK-YES: call float @cimagf
     49 }
     50