blob: 6d82f8af51ffdf7de9433d9f78c8c6f767c07fef [file] [log] [blame]
Daniel Dunbara933c3c2008-07-21 18:44:41 +00001// 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
8void 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
17int 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}