aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGen
diff options
context:
space:
mode:
authorEli Bendersky <eliben@chromium.org>2013-07-12 15:19:54 -0700
committerEli Bendersky <eliben@chromium.org>2013-07-12 15:19:54 -0700
commit99a5501f5ae5b75017dfc386d4abf648234e85df (patch)
treea662eae5ea83e9317fb6ae61f0eaea005bd4d1f0 /test/CodeGen
parent3fd9ccdd9f8d259bcf518e7056cfd419d992e984 (diff)
parentf69ebb4201da8bb5045f9335150ed6ef6bcfc2cc (diff)
Merge branch 'master' of http://git.chromium.org/native_client/pnacl-clang
Diffstat (limited to 'test/CodeGen')
-rw-r--r--test/CodeGen/le32-libcall-pow.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/CodeGen/le32-libcall-pow.c b/test/CodeGen/le32-libcall-pow.c
new file mode 100644
index 0000000000..c2f892c3ae
--- /dev/null
+++ b/test/CodeGen/le32-libcall-pow.c
@@ -0,0 +1,21 @@
+// RUN: %clang_cc1 -fmath-errno -emit-llvm -o - %s -triple le32-unknown-nacl | FileCheck %s
+// RUN: %clang_cc1 -emit-llvm -o - %s -triple le32-unknown-nacl | FileCheck %s
+
+// le32 (PNaCl) never generates intrinsics for pow calls, with or without errno
+
+// CHECK: define void @test_pow
+void test_pow(float a0, double a1, long double a2) {
+ // CHECK: call float @powf
+ float l0 = powf(a0, a0);
+
+ // CHECK: call double @pow
+ double l1 = pow(a1, a1);
+
+ // CHECK: call double @powl
+ long double l2 = powl(a2, a2);
+}
+
+// CHECK: declare float @powf(float, float)
+// CHECK: declare double @pow(double, double)
+// CHECK: declare double @powl(double, double)
+