| Daniel Dunbar | a933c3c | 2008-07-21 18:44:41 +0000 | [diff] [blame] | 1 | // RUN: clang -emit-llvm -o - %s > %t |
| 2 | // RUN: ! grep "__builtin" %t | ||||
| 3 | |||||
| 4 | #include <stdio.h> | ||||
| 5 | #include <stdlib.h> | ||||
| 6 | #include <math.h> | ||||
| 7 | |||||
| 8 | void test(long double a, int b) { | ||||
| 9 | printf("%Lf**%d: %08x %08x %016Lx\n", | ||||
| 10 | a, b, | ||||
| 11 | __builtin_powi(a, b), | ||||
| 12 | __builtin_powif(a, b), | ||||
| 13 | __builtin_powil(a, b) | ||||
| 14 | ); | ||||
| 15 | } | ||||
| 16 | |||||
| 17 | int main() { | ||||
| 18 | int i; | ||||
| 19 | |||||
| 20 | test(-1,-1LL); | ||||
| 21 | test(0,0); | ||||
| 22 | test(1,1); | ||||
| 23 | |||||
| 24 | for (i=0; i<3; i++) { | ||||
| 25 | test(random(), i); | ||||
| 26 | } | ||||
| 27 | |||||
| 28 | return 0; | ||||
| 29 | } | ||||