summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-05-02 22:07:34 +0000
committerChris Lattner <sabre@nondot.org>2008-05-02 22:07:34 +0000
commit4d5b8ccd0717a08dd24d17709d2b9d15a4ecf003 (patch)
tree76193af0d39ee495c7cf1eb28f8abbb4c9305bd5 /test
parent866b9e1520279303bc24b2fb4f709dc62ad7c96d (diff)
downloadllvm-4d5b8ccd0717a08dd24d17709d2b9d15a4ecf003.tar.gz
llvm-4d5b8ccd0717a08dd24d17709d2b9d15a4ecf003.tar.bz2
llvm-4d5b8ccd0717a08dd24d17709d2b9d15a4ecf003.tar.xz
verify builtin optimization works like gcc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50594 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/CFrontend/libcalls.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/CFrontend/libcalls.c b/test/CFrontend/libcalls.c
new file mode 100644
index 0000000000..c027ea4125
--- /dev/null
+++ b/test/CFrontend/libcalls.c
@@ -0,0 +1,10 @@
+// llvm-gcc -O1+ should run simplify libcalls, O0 shouldn't
+// and -fno-builtins shouldn't.
+// RUN: %llvmgcc %s -S -emit-llvm -O0 -o - | grep {call.*exp2f}
+// RUN: %llvmgcc %s -S -emit-llvm -O1 -o - | grep {call.*ldexp}
+// RUN: %llvmgcc %s -S -emit-llvm -O3 -fno-builtin -o - | grep {call.*exp2f}
+
+float t4(unsigned char x) {
+ return exp2f(x);
+}
+