blob: 5b413a889502e4dae68e9244b48c1062c893e78c [file] [log] [blame]
Daniel Dunbar025f80d2009-07-25 11:27:37 +00001// RUN: clang-cc -emit-llvm -o - %s > %t &&
2// RUN: not grep "__builtin" %t
Daniel Dunbara933c3c2008-07-21 18:44:41 +00003
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}