xref: /minix3/external/bsd/llvm/dist/clang/test/CodeGen/libcalls-complex.c (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -fno-builtin -emit-llvm -o - %s -triple i386-unknown-unknown | FileCheck -check-prefix CHECK-YES %s
2*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -emit-llvm -o - %s -triple i386-unknown-unknown | FileCheck -check-prefix CHECK-NO %s
3*f4a2713aSLionel Sambuc 
4*f4a2713aSLionel Sambuc extern float crealf(float _Complex);
5*f4a2713aSLionel Sambuc extern double creal(double _Complex);
6*f4a2713aSLionel Sambuc extern long double creall(long double _Complex);
7*f4a2713aSLionel Sambuc 
8*f4a2713aSLionel Sambuc extern float cimagf(float _Complex);
9*f4a2713aSLionel Sambuc extern double cimag(double _Complex);
10*f4a2713aSLionel Sambuc extern long double cimagl(long double _Complex);
11*f4a2713aSLionel Sambuc 
test_creal(double _Complex z)12*f4a2713aSLionel Sambuc double test_creal(double _Complex z) {
13*f4a2713aSLionel Sambuc   return creal(z);
14*f4a2713aSLionel Sambuc   // CHECK-NO-NOT: call double @creal
15*f4a2713aSLionel Sambuc   // CHECK-YES: call double @creal
16*f4a2713aSLionel Sambuc }
17*f4a2713aSLionel Sambuc 
test_creall(double _Complex z)18*f4a2713aSLionel Sambuc long double test_creall(double _Complex z) {
19*f4a2713aSLionel Sambuc   return creall(z);
20*f4a2713aSLionel Sambuc   // CHECK-NO-NOT: call x86_fp80 @creall
21*f4a2713aSLionel Sambuc   // CHECK-YES: call x86_fp80 @creall
22*f4a2713aSLionel Sambuc }
23*f4a2713aSLionel Sambuc 
test_crealf(double _Complex z)24*f4a2713aSLionel Sambuc float test_crealf(double _Complex z) {
25*f4a2713aSLionel Sambuc   return crealf(z);
26*f4a2713aSLionel Sambuc   // CHECK-NO-NOT: call float @crealf
27*f4a2713aSLionel Sambuc   // CHECK-YES: call float @crealf
28*f4a2713aSLionel Sambuc }
29*f4a2713aSLionel Sambuc 
test_cimag(double _Complex z)30*f4a2713aSLionel Sambuc double test_cimag(double _Complex z) {
31*f4a2713aSLionel Sambuc   return cimag(z);
32*f4a2713aSLionel Sambuc   // CHECK-NO-NOT: call double @cimag
33*f4a2713aSLionel Sambuc   // CHECK-YES: call double @cimag
34*f4a2713aSLionel Sambuc }
35*f4a2713aSLionel Sambuc 
test_cimagl(double _Complex z)36*f4a2713aSLionel Sambuc long double test_cimagl(double _Complex z) {
37*f4a2713aSLionel Sambuc   return cimagl(z);
38*f4a2713aSLionel Sambuc   // CHECK-NO-NOT: call x86_fp80 @cimagl
39*f4a2713aSLionel Sambuc   // CHECK-YES: call x86_fp80 @cimagl
40*f4a2713aSLionel Sambuc }
41*f4a2713aSLionel Sambuc 
test_cimagf(double _Complex z)42*f4a2713aSLionel Sambuc float test_cimagf(double _Complex z) {
43*f4a2713aSLionel Sambuc   return cimagf(z);
44*f4a2713aSLionel Sambuc   // CHECK-NO-NOT: call float @cimagf
45*f4a2713aSLionel Sambuc   // CHECK-YES: call float @cimagf
46*f4a2713aSLionel Sambuc }
47