blob: cbbde8a9f3fda7a3cfa73485c1c603707f0b67e0 [file] [log] [blame]
Daniel Dunbar4fcfde42009-11-08 01:45:36 +00001// RUN: clang-cc -fmath-errno=1 -emit-llvm -o %t %s -triple i386-unknown-unknown
2// RUN: grep "declare " %t | count 6
3// RUN: grep "declare " %t | grep "@llvm." | count 1
4// RUN: clang-cc -fmath-errno=0 -emit-llvm -o %t %s -triple i386-unknown-unknown
5// RUN: grep "declare " %t | count 6
Daniel Dunbaref2abfe2009-02-16 22:43:43 +00006// 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.
10float sqrtf(float) __attribute__((const));
11
12void 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
18void 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}