blob: a96176afe5be88520d097ac881d660d4058030f1 [file] [log] [blame]
Dan Gohmanc31176d2010-01-08 02:20:44 +00001// RUN: %clang_cc1 -fmath-errno -emit-llvm -o %t %s -triple i386-unknown-unknown
Daniel Dunbar4fcfde42009-11-08 01:45:36 +00002// RUN: grep "declare " %t | count 6
3// RUN: grep "declare " %t | grep "@llvm." | count 1
Dan Gohmanc31176d2010-01-08 02:20:44 +00004// RUN: %clang_cc1 -emit-llvm -o %t %s -triple i386-unknown-unknown
Daniel Dunbar4fcfde42009-11-08 01:45:36 +00005// 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}