xref: /llvm-project/clang/test/CodeGen/aix-builtin-mapping.c (revision b15bf305ca3e9ce63aaef7247d32fb3a75174531)
1 // AIX library functions frexpl, ldexpl, and modfl are for 128-bit IBM
2 // 'long double' (i.e. __ibm128). Check that the compiler generates
3 // calls to the 'double' versions for corresponding builtin functions in
4 // 64-bit 'long double' mode.
5 
6 // RUN: %clang_cc1 -triple powerpc-ibm-aix -mlong-double-64 -emit-llvm -o - %s | FileCheck -check-prefix=CHECK %s
7 // RUN: %clang_cc1 -triple powerpc64-ibm-aix -mlong-double-64 -emit-llvm -o - %s | FileCheck -check-prefix=CHECK %s
8 
main()9 int main()
10 {
11   int DummyInt;
12   long double DummyLongDouble;
13   long double returnValue;
14 
15   returnValue = __builtin_modfl(1.0L, &DummyLongDouble);
16   returnValue = __builtin_frexpl(0.0L, &DummyInt);
17   returnValue = __builtin_ldexpl(1.0L, 1);
18 }
19 
20 // CHECK: %call = call double @modf(double noundef 1.000000e+00, ptr noundef %DummyLongDouble) #3
21 // CHECK: %{{.+}} = call { double, i32 } @llvm.frexp.f64.i32(double 0.000000e+00)
22 // CHECK: %{{.+}} = call double @llvm.ldexp.f64.i32(double 1.000000e+00, i32 1)
23