2017-11-01 04:19:39 +08:00
|
|
|
// RUN: %clang_cc1 -fmath-errno -triple x86_64-apple-darwin %s -emit-llvm -o - | FileCheck %s --check-prefix=HAS_ERRNO
|
|
|
|
// RUN: %clang_cc1 -triple x86_64-apple-darwin %s -emit-llvm -o - | FileCheck %s --check-prefix=NO_ERRNO
|
|
|
|
|
2017-11-03 04:39:26 +08:00
|
|
|
// FIXME: If the builtin does not set errno, it should be converted to an LLVM intrinsic.
|
2017-11-01 04:19:39 +08:00
|
|
|
|
|
|
|
float foo(float X) {
|
|
|
|
// HAS_ERRNO: call float @sqrtf(float
|
|
|
|
// NO_ERRNO: call float @sqrtf(float
|
|
|
|
return __builtin_sqrtf(X);
|
|
|
|
}
|
|
|
|
|
|
|
|
// HAS_ERRNO: declare float @sqrtf(float) [[ATTR:#[0-9]+]]
|
2017-11-03 04:39:26 +08:00
|
|
|
// HAS_ERRNO-NOT: attributes [[ATTR]] = {{{.*}} readnone
|
2017-11-01 04:19:39 +08:00
|
|
|
|
|
|
|
// NO_ERRNO: declare float @sqrtf(float) [[ATTR:#[0-9]+]]
|
|
|
|
// NO_ERRNO: attributes [[ATTR]] = { nounwind readnone {{.*}}}
|
|
|
|
|