X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=test%2FTransforms%2FInstCombine%2Fexp2-1.ll;h=8e6a0e0d93f6f057bd65b98dbf98d4b26e016c59;hb=fd48a80e144fdca6e5c7e6091942f70c2ea4ea8f;hp=99fb9ecfd2b2fc9b368ffc50ebc2f9aa153030bf;hpb=39f4e8d9cce22b60a3417a5f17c847fa5b1daebf;p=oota-llvm.git diff --git a/test/Transforms/InstCombine/exp2-1.ll b/test/Transforms/InstCombine/exp2-1.ll index 99fb9ecfd2b..8e6a0e0d93f 100644 --- a/test/Transforms/InstCombine/exp2-1.ll +++ b/test/Transforms/InstCombine/exp2-1.ll @@ -1,6 +1,7 @@ ; Test that the exp2 library call simplifier works correctly. ; ; RUN: opt < %s -instcombine -S | FileCheck %s +; RUN: opt < %s -instcombine -S -mtriple=i386-pc-win32 | FileCheck %s -check-prefix=CHECK-WIN target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128" @@ -74,3 +75,26 @@ define float @test_simplify8(i8 zeroext %x) { ; CHECK: call float @ldexpf ret float %ret } + +declare double @llvm.exp2.f64(double) +declare float @llvm.exp2.f32(float) + +define double @test_simplify9(i8 zeroext %x) { +; CHECK-LABEL: @test_simplify9( +; CHECK-WIN-LABEL: @test_simplify9( + %conv = uitofp i8 %x to double + %ret = call double @llvm.exp2.f64(double %conv) +; CHECK: call double @ldexp +; CHECK-WIN: call double @ldexp + ret double %ret +} + +define float @test_simplify10(i8 zeroext %x) { +; CHECK-LABEL: @test_simplify10( +; CHECK-WIN-LABEL: @test_simplify10( + %conv = uitofp i8 %x to float + %ret = call float @llvm.exp2.f32(float %conv) +; CHECK: call float @ldexpf +; CHECK-WIN-NOT: call float @ldexpf + ret float %ret +}