Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CodeGen / builtin-sqrt.c
blob2313a68d2d0e20d6f1e7c20f8149f2ce93724993
1 // RUN: %clang_cc1 -fmath-errno -triple x86_64-apple-darwin %s -emit-llvm -o - | FileCheck %s --check-prefix=HAS_ERRNO
2 // RUN: %clang_cc1 -triple x86_64-apple-darwin %s -emit-llvm -o - | FileCheck %s --check-prefix=NO_ERRNO
4 float foo(float X) {
5 // HAS_ERRNO: call float @sqrtf(float
6 // NO_ERRNO: call float @llvm.sqrt.f32(float
7 return __builtin_sqrtf(X);
10 // HAS_ERRNO: declare float @sqrtf(float noundef) [[ATTR:#[0-9]+]]
11 // HAS_ERRNO-NOT: attributes [[ATTR]] = {{{.*}} memory(none)
13 // NO_ERRNO: declare float @llvm.sqrt.f32(float) [[ATTR:#[0-9]+]]
14 // NO_ERRNO: attributes [[ATTR]] = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }