]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/CodeGen/libcalls-complex.c
Vendor import of clang release_34 branch r197841 (effectively, 3.4 RC3):
[FreeBSD/FreeBSD.git] / test / CodeGen / libcalls-complex.c
1 // RUN: %clang_cc1 -fno-builtin -emit-llvm -o - %s -triple i386-unknown-unknown | FileCheck -check-prefix CHECK-YES %s
2 // RUN: %clang_cc1 -emit-llvm -o - %s -triple i386-unknown-unknown | FileCheck -check-prefix CHECK-NO %s
3
4 extern float crealf(float _Complex);
5 extern double creal(double _Complex);
6 extern long double creall(long double _Complex);
7
8 extern float cimagf(float _Complex);
9 extern double cimag(double _Complex);
10 extern long double cimagl(long double _Complex);
11
12 double test_creal(double _Complex z) {
13   return creal(z);
14   // CHECK-NO-NOT: call double @creal
15   // CHECK-YES: call double @creal
16 }
17
18 long double test_creall(double _Complex z) {
19   return creall(z);
20   // CHECK-NO-NOT: call x86_fp80 @creall
21   // CHECK-YES: call x86_fp80 @creall
22 }
23
24 float test_crealf(double _Complex z) {
25   return crealf(z);
26   // CHECK-NO-NOT: call float @crealf
27   // CHECK-YES: call float @crealf
28 }
29
30 double test_cimag(double _Complex z) {
31   return cimag(z);
32   // CHECK-NO-NOT: call double @cimag
33   // CHECK-YES: call double @cimag
34 }
35
36 long double test_cimagl(double _Complex z) {
37   return cimagl(z);
38   // CHECK-NO-NOT: call x86_fp80 @cimagl
39   // CHECK-YES: call x86_fp80 @cimagl
40 }
41
42 float test_cimagf(double _Complex z) {
43   return cimagf(z);
44   // CHECK-NO-NOT: call float @cimagf
45   // CHECK-YES: call float @cimagf
46 }