1*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -triple x86_64-apple-darwin %s -emit-llvm -o - -fmath-errno | FileCheck %s 2*f4a2713aSLionel Sambuc // llvm.sqrt has undefined behavior on negative inputs, so it is 3*f4a2713aSLionel Sambuc // inappropriate to translate C/C++ sqrt to this. 4*f4a2713aSLionel Sambuc 5*f4a2713aSLionel Sambuc float sqrtf(float x); foo(float X)6*f4a2713aSLionel Sambucfloat foo(float X) { 7*f4a2713aSLionel Sambuc // CHECK: foo 8*f4a2713aSLionel Sambuc // CHECK-NOT: readonly 9*f4a2713aSLionel Sambuc // CHECK: call float @sqrtf 10*f4a2713aSLionel Sambuc // Check that this is not marked readonly when errno is used. 11*f4a2713aSLionel Sambuc return sqrtf(X); 12*f4a2713aSLionel Sambuc } 13