xref: /minix3/external/bsd/llvm/dist/clang/test/CodeGen/2009-09-24-SqrtErrno.c (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1 // RUN: %clang_cc1 -triple x86_64-apple-darwin %s -emit-llvm -o - -fmath-errno | FileCheck %s
2 // llvm.sqrt has undefined behavior on negative inputs, so it is
3 // inappropriate to translate C/C++ sqrt to this.
4 
5 float sqrtf(float x);
foo(float X)6 float foo(float X) {
7 // CHECK: foo
8 // CHECK-NOT: readonly
9 // CHECK: call float @sqrtf
10   // Check that this is not marked readonly when errno is used.
11   return sqrtf(X);
12 }
13