blob: 9224fe10c75824404d3de8e06ac346fe0671276b [file] [log] [blame]
Daniel Dunbaref2abfe2009-02-16 22:43:43 +00001// RUN: clang -fmath-errno=1 -emit-llvm -o %t %s &&
2// RUN: grep "declare " %t | count 6 &&
3// RUN: grep "declare " %t | grep "@llvm." | count 1 &&
4// RUN: clang -fmath-errno=0 -emit-llvm -o %t %s &&
5// RUN: grep "declare " %t | count 6 &&
6// RUN: grep "declare " %t | grep -v "@llvm." | count 0
7
8// IRgen only pays attention to const; it should always call llvm for
9// this.
10float sqrtf(float) __attribute__((const));
11
12void test_sqrt(float a0, double a1, long double a2) {
13 float l0 = sqrtf(a0);
14 double l1 = sqrt(a1);
15 long double l2 = sqrtl(a2);
16}
17
18void test_pow(float a0, double a1, long double a2) {
19 float l0 = powf(a0, a0);
20 double l1 = pow(a1, a1);
21 long double l2 = powl(a2, a2);
22}