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