xref: /aosp_15_r20/external/clang/test/CodeGen/libcalls-ld.c (revision 67e74705e28f6214e480b399dd47ea732279e315)
1*67e74705SXin Li // llvm-gcc -O1+ should run simplify libcalls, O0 shouldn't
2*67e74705SXin Li // and -fno-builtins shouldn't.
3*67e74705SXin Li // -fno-math-errno should emit an llvm intrinsic, -fmath-errno should not.
4*67e74705SXin Li // RUN: %clang_cc1 %s -emit-llvm -fno-math-errno -o - | grep {call.*exp2\\..*f}
5*67e74705SXin Li // RUN: %clang_cc1 %s -emit-llvm -fmath-errno -o - | grep {call.*exp2l}
6*67e74705SXin Li // RUN: %clang_cc1 %s -emit-llvm -O1 -o - | grep {call.*ldexp}
7*67e74705SXin Li // RUN: %clang_cc1 %s -emit-llvm -O3 -fno-builtin -o - | grep {call.*exp2l}
8*67e74705SXin Li 
9*67e74705SXin Li // clang doesn't support this yet.
10*67e74705SXin Li // XFAIL: *
11*67e74705SXin Li 
12*67e74705SXin Li // If this fails for you because your target doesn't support long double,
13*67e74705SXin Li // please xfail the test.
14*67e74705SXin Li 
15*67e74705SXin Li long double exp2l(long double);
16*67e74705SXin Li 
t4(unsigned char x)17*67e74705SXin Li long double t4(unsigned char x) {
18*67e74705SXin Li   return exp2l(x);
19*67e74705SXin Li }
20