xref: /aosp_15_r20/external/clang/test/CodeGen/2005-07-20-SqrtNoErrno.c (revision 67e74705e28f6214e480b399dd47ea732279e315)
1 // RUN: %clang_cc1 -triple x86_64-apple-darwin %s -emit-llvm -o - | FileCheck %s
2 // llvm.sqrt has undefined behavior on negative inputs, so it is
3 // inappropriate to translate C/C++ sqrt to this.
4 float sqrtf(float x);
foo(float X)5 float foo(float X) {
6   // CHECK: foo
7   // CHECK: call float @sqrtf(float %
8   // Check that this is marked readonly when errno is ignored.
9   return sqrtf(X);
10 }
11