2009-09-25 07:37:40 +08:00
|
|
|
// RUN: %llvmgcc %s -S -o - -fno-math-errno | FileCheck %s
|
2009-09-24 05:46:36 +08:00
|
|
|
// llvm.sqrt has undefined behavior on negative inputs, so it is
|
|
|
|
// inappropriate to translate C/C++ sqrt to this.
|
2005-07-21 09:09:27 +08:00
|
|
|
#include <math.h>
|
|
|
|
|
|
|
|
float foo(float X) {
|
2009-09-25 07:37:40 +08:00
|
|
|
// CHECK: foo
|
|
|
|
// CHECK: sqrtf(float %1) nounwind readonly
|
|
|
|
// Check that this is marked readonly when errno is ignored.
|
2005-07-21 09:09:27 +08:00
|
|
|
return sqrtf(X);
|
|
|
|
}
|