From 9300de4d1cd151828ab2548c242d34d6ad9124d4 Mon Sep 17 00:00:00 2001 From: Sanjay Patel Date: Tue, 14 Jul 2020 09:28:57 -0400 Subject: [PATCH] [InstSimplify] add test with nobuiltin attribute (PR46627); NFC --- llvm/test/Transforms/InstSimplify/call.ll | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/llvm/test/Transforms/InstSimplify/call.ll b/llvm/test/Transforms/InstSimplify/call.ll index 9d0147b5ba52c..019def569f15b 100644 --- a/llvm/test/Transforms/InstSimplify/call.ll +++ b/llvm/test/Transforms/InstSimplify/call.ll @@ -1038,3 +1038,19 @@ define i32 @call_undef_musttail() { %x = musttail call i32 undef() ret i32 %x } + +; FIXME: This is not the builtin fmax, so we don't know anything about its behavior. + +define float @nobuiltin_fmax() { +; CHECK-LABEL: @nobuiltin_fmax( +; CHECK-NEXT: [[M:%.*]] = call float @fmaxf(float 0.000000e+00, float 1.000000e+00) #3 +; CHECK-NEXT: ret float [[M]] +; + %m = call float @fmaxf(float 0.0, float 1.0) #0 + %r = call float @llvm.fabs.f32(float %m) + ret float %r +} + +declare float @fmaxf(float, float) + +attributes #0 = { nobuiltin readnone }