Daniel Dunbar | ef2abfe | 2009-02-16 22:43:43 +0000 | [diff] [blame] | 1 | // 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. |
| 10 | float sqrtf(float) __attribute__((const)); |
| 11 | |
| 12 | void 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 | |
| 18 | void 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 | } |