Dan Gohman | c31176d | 2010-01-08 02:20:44 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fmath-errno -emit-llvm -o %t %s -triple i386-unknown-unknown |
Daniel Dunbar | 4fcfde4 | 2009-11-08 01:45:36 +0000 | [diff] [blame] | 2 | // RUN: grep "declare " %t | count 6 |
| 3 | // RUN: grep "declare " %t | grep "@llvm." | count 1 |
Dan Gohman | c31176d | 2010-01-08 02:20:44 +0000 | [diff] [blame] | 4 | // RUN: %clang_cc1 -emit-llvm -o %t %s -triple i386-unknown-unknown |
Daniel Dunbar | 4fcfde4 | 2009-11-08 01:45:36 +0000 | [diff] [blame] | 5 | // RUN: grep "declare " %t | count 6 |
Daniel Dunbar | ef2abfe | 2009-02-16 22:43:43 +0000 | [diff] [blame] | 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 | } |