blob: a2761dd5b004fd336150cf4e143632c328a090e0 [file] [log] [blame]
Chris Lattner4d5b8cc2008-05-02 22:07:34 +00001// llvm-gcc -O1+ should run simplify libcalls, O0 shouldn't
2// and -fno-builtins shouldn't.
Dale Johannesenfe896692008-09-04 21:24:28 +00003// -fno-math-errno should emit an llvm intrinsic, -fmath-errno should not.
4// RUN: %llvmgcc %s -S -emit-llvm -fno-math-errno -O0 -o - | grep {call.*exp2\\.f32}
5// RUN: %llvmgcc %s -S -emit-llvm -fmath-errno -O0 -o - | grep {call.*exp2f}
Chris Lattner4d5b8cc2008-05-02 22:07:34 +00006// RUN: %llvmgcc %s -S -emit-llvm -O1 -o - | grep {call.*ldexp}
7// RUN: %llvmgcc %s -S -emit-llvm -O3 -fno-builtin -o - | grep {call.*exp2f}
8
Matthijs Kooijmanb7e103b2008-06-10 14:37:44 +00009float exp2f(float);
10
Chris Lattner4d5b8cc2008-05-02 22:07:34 +000011float t4(unsigned char x) {
12 return exp2f(x);
13}
14