xref: /aosp_15_r20/external/clang/test/CodeGen/le32-libcall-pow.c (revision 67e74705e28f6214e480b399dd47ea732279e315)
1*67e74705SXin Li // RUN: %clang_cc1 -fno-math-builtin -fmath-errno -emit-llvm -o - %s -triple le32-unknown-nacl | FileCheck %s
2*67e74705SXin Li // RUN: %clang_cc1 -fno-math-builtin -emit-llvm -o - %s -triple le32-unknown-nacl | FileCheck %s
3*67e74705SXin Li 
4*67e74705SXin Li // le32 (PNaCl) never generates intrinsics for pow calls, with or without
5*67e74705SXin Li // errno, when the -fno-math-builtin flag is passed to -cc1. A separate test
6*67e74705SXin Li // makes sure this flag is indeed passed for le32.
7*67e74705SXin Li 
8*67e74705SXin Li float powf(float, float);
9*67e74705SXin Li double pow(double, double);
10*67e74705SXin Li long double powl(long double, long double);
11*67e74705SXin Li 
12*67e74705SXin Li // CHECK-LABEL: define void @test_pow
test_pow(float a0,double a1,long double a2)13*67e74705SXin Li void test_pow(float a0, double a1, long double a2) {
14*67e74705SXin Li   // CHECK: call float @powf
15*67e74705SXin Li   float l0 = powf(a0, a0);
16*67e74705SXin Li 
17*67e74705SXin Li   // CHECK: call double @pow
18*67e74705SXin Li   double l1 = pow(a1, a1);
19*67e74705SXin Li 
20*67e74705SXin Li   // CHECK: call double @powl
21*67e74705SXin Li   long double l2 = powl(a2, a2);
22*67e74705SXin Li }
23*67e74705SXin Li 
24*67e74705SXin Li // CHECK: declare float @powf(float, float)
25*67e74705SXin Li // CHECK: declare double @pow(double, double)
26*67e74705SXin Li // CHECK: declare double @powl(double, double)
27*67e74705SXin Li 
28