13883e66cfd55de70d89831cf26f9ae53931d11d3Eric Christopher// llvm-gcc -O1+ should run simplify libcalls, O0 shouldn't
23883e66cfd55de70d89831cf26f9ae53931d11d3Eric Christopher// and -fno-builtins shouldn't.
33883e66cfd55de70d89831cf26f9ae53931d11d3Eric Christopher// -fno-math-errno should emit an llvm intrinsic, -fmath-errno should not.
4a3f55b026fc24db6a4e275a8e4110d071122b99dRafael Espindola// RUN: %clang_cc1 %s -emit-llvm -fno-math-errno -o - | grep {call.*exp2\\.f64}
5a3f55b026fc24db6a4e275a8e4110d071122b99dRafael Espindola// RUN: %clang_cc1 %s -emit-llvm -fmath-errno -o - | grep {call.*exp2}
63883e66cfd55de70d89831cf26f9ae53931d11d3Eric Christopher// RUN: %clang_cc1 %s -emit-llvm -O1 -o - | grep {call.*ldexp}
73883e66cfd55de70d89831cf26f9ae53931d11d3Eric Christopher// RUN: %clang_cc1 %s -emit-llvm -O3 -fno-builtin -o - | grep {call.*exp2}
83883e66cfd55de70d89831cf26f9ae53931d11d3Eric Christopher
93883e66cfd55de70d89831cf26f9ae53931d11d3Eric Christopher// clang doesn't support this yet.
103883e66cfd55de70d89831cf26f9ae53931d11d3Eric Christopher// XFAIL: *
113883e66cfd55de70d89831cf26f9ae53931d11d3Eric Christopher
123883e66cfd55de70d89831cf26f9ae53931d11d3Eric Christopherdouble exp2(double);
133883e66cfd55de70d89831cf26f9ae53931d11d3Eric Christopher
143883e66cfd55de70d89831cf26f9ae53931d11d3Eric Christopherdouble t4(unsigned char x) {
153883e66cfd55de70d89831cf26f9ae53931d11d3Eric Christopher  return exp2(x);
163883e66cfd55de70d89831cf26f9ae53931d11d3Eric Christopher}
17