summaryrefslogtreecommitdiffstats
path: root/test/CodeGen/libcalls.c
blob: 32fc59f27fee18235d98de4dd14ef76b08e56464 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// RUN: clang-cc -emit-llvm -o %t %s -triple i386-unknown-unknown
// RUN: grep "declare " %t | count 6
// RUN: grep "declare " %t | grep "@llvm." | count 1
// RUN: clang-cc -fno-math-errno -emit-llvm -o %t %s -triple i386-unknown-unknown
// RUN: grep "declare " %t | count 6
// RUN: grep "declare " %t | grep -v "@llvm." | count 0

// IRgen only pays attention to const; it should always call llvm for
// this.
float sqrtf(float) __attribute__((const));

void test_sqrt(float a0, double a1, long double a2) {
  float l0 = sqrtf(a0);
  double l1 = sqrt(a1);
  long double l2 = sqrtl(a2);
}

void test_pow(float a0, double a1, long double a2) {
  float l0 = powf(a0, a0);
  double l1 = pow(a1, a1);
  long double l2 = powl(a2, a2);
}