From 4d5b8ccd0717a08dd24d17709d2b9d15a4ecf003 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Fri, 2 May 2008 22:07:34 +0000 Subject: [PATCH] verify builtin optimization works like gcc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50594 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/CFrontend/libcalls.c | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 test/CFrontend/libcalls.c diff --git a/test/CFrontend/libcalls.c b/test/CFrontend/libcalls.c new file mode 100644 index 00000000000..c027ea4125e --- /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); +} +