18 lines · plain
1; RUN: opt -passes=instcombine -S -disable-simplify-libcalls < %s | FileCheck %s2; rdar://104664103 4; Instcombine tries to fold (fptrunc (sqrt (fpext x))) -> (sqrtf x), but this5; shouldn't fold when sqrtf isn't available.6define float @foo(float %f) uwtable ssp {7entry:8; CHECK: %conv = fpext float %f to double9; CHECK: %call = tail call double @sqrt(double %conv)10; CHECK: %conv1 = fptrunc double %call to float11 %conv = fpext float %f to double12 %call = tail call double @sqrt(double %conv)13 %conv1 = fptrunc double %call to float14 ret float %conv115}16 17declare double @sqrt(double)18