From: Dale Johannesen Date: Mon, 19 Jan 2009 22:33:12 +0000 (+0000) Subject: Move & restructure test per review. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=549170206ecc31839723cb4b4de3d872a9402813;p=oota-llvm.git Move & restructure test per review. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62538 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/CodeGen/X86/2009-01-19-fmod-constant-float.ll b/test/CodeGen/X86/2009-01-19-fmod-constant-float.ll deleted file mode 100644 index 0ff2dd4a596..00000000000 --- a/test/CodeGen/X86/2009-01-19-fmod-constant-float.ll +++ /dev/null @@ -1,77 +0,0 @@ -; RUN: llvm-as < %s | opt -std-compile-opts | llc | grep 1036831949 | count 2 -; RUN: llvm-as < %s | opt -std-compile-opts | llc | grep 3184315597 | count 2 -; check constant folding for 'frem'. PR 3316. - -; ModuleID = 'tt.c' -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" -target triple = "i386-apple-darwin9.6" - -define float @test1() nounwind { -entry: - %retval = alloca float ; [#uses=2] - %0 = alloca float ; [#uses=2] - %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] - %1 = call double @fmod(double 1.000000e-01, double 1.000000e+00) nounwind readonly ; [#uses=1] - %2 = fptrunc double %1 to float ; [#uses=1] - store float %2, float* %0, align 4 - %3 = load float* %0, align 4 ; [#uses=1] - store float %3, float* %retval, align 4 - br label %return - -return: ; preds = %entry - %retval1 = load float* %retval ; [#uses=1] - ret float %retval1 -} - -declare double @fmod(double, double) nounwind readonly - -define float @test2() nounwind { -entry: - %retval = alloca float ; [#uses=2] - %0 = alloca float ; [#uses=2] - %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] - %1 = call double @fmod(double -1.000000e-01, double 1.000000e+00) nounwind readonly ; [#uses=1] - %2 = fptrunc double %1 to float ; [#uses=1] - store float %2, float* %0, align 4 - %3 = load float* %0, align 4 ; [#uses=1] - store float %3, float* %retval, align 4 - br label %return - -return: ; preds = %entry - %retval1 = load float* %retval ; [#uses=1] - ret float %retval1 -} - -define float @test3() nounwind { -entry: - %retval = alloca float ; [#uses=2] - %0 = alloca float ; [#uses=2] - %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] - %1 = call double @fmod(double 1.000000e-01, double -1.000000e+00) nounwind readonly ; [#uses=1] - %2 = fptrunc double %1 to float ; [#uses=1] - store float %2, float* %0, align 4 - %3 = load float* %0, align 4 ; [#uses=1] - store float %3, float* %retval, align 4 - br label %return - -return: ; preds = %entry - %retval1 = load float* %retval ; [#uses=1] - ret float %retval1 -} - -define float @test4() nounwind { -entry: - %retval = alloca float ; [#uses=2] - %0 = alloca float ; [#uses=2] - %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] - %1 = call double @fmod(double -1.000000e-01, double -1.000000e+00) nounwind readonly ; [#uses=1] - %2 = fptrunc double %1 to float ; [#uses=1] - store float %2, float* %0, align 4 - %3 = load float* %0, align 4 ; [#uses=1] - store float %3, float* %retval, align 4 - br label %return - -return: ; preds = %entry - %retval1 = load float* %retval ; [#uses=1] - ret float %retval1 -} diff --git a/test/Transforms/InstCombine/2009-01-19-fmod-constant-float.ll b/test/Transforms/InstCombine/2009-01-19-fmod-constant-float.ll new file mode 100644 index 00000000000..7c63ff69246 --- /dev/null +++ b/test/Transforms/InstCombine/2009-01-19-fmod-constant-float.ll @@ -0,0 +1,77 @@ +; RUN: llvm-as < %s | opt -simplifycfg -instcombine | llvm-dis | grep 0x3FB99999A0000000 | count 2 +; RUN: llvm-as < %s | opt -simplifycfg -instcombine | llvm-dis | grep 0xBFB99999A0000000 | count 2 +; check constant folding for 'frem'. PR 3316. + +; ModuleID = 'tt.c' +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" +target triple = "i386-apple-darwin9.6" + +define float @test1() nounwind { +entry: + %retval = alloca float ; [#uses=2] + %0 = alloca float ; [#uses=2] + %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] + %1 = call double @fmod(double 1.000000e-01, double 1.000000e+00) nounwind readonly ; [#uses=1] + %2 = fptrunc double %1 to float ; [#uses=1] + store float %2, float* %0, align 4 + %3 = load float* %0, align 4 ; [#uses=1] + store float %3, float* %retval, align 4 + br label %return + +return: ; preds = %entry + %retval1 = load float* %retval ; [#uses=1] + ret float %retval1 +} + +declare double @fmod(double, double) nounwind readonly + +define float @test2() nounwind { +entry: + %retval = alloca float ; [#uses=2] + %0 = alloca float ; [#uses=2] + %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] + %1 = call double @fmod(double -1.000000e-01, double 1.000000e+00) nounwind readonly ; [#uses=1] + %2 = fptrunc double %1 to float ; [#uses=1] + store float %2, float* %0, align 4 + %3 = load float* %0, align 4 ; [#uses=1] + store float %3, float* %retval, align 4 + br label %return + +return: ; preds = %entry + %retval1 = load float* %retval ; [#uses=1] + ret float %retval1 +} + +define float @test3() nounwind { +entry: + %retval = alloca float ; [#uses=2] + %0 = alloca float ; [#uses=2] + %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] + %1 = call double @fmod(double 1.000000e-01, double -1.000000e+00) nounwind readonly ; [#uses=1] + %2 = fptrunc double %1 to float ; [#uses=1] + store float %2, float* %0, align 4 + %3 = load float* %0, align 4 ; [#uses=1] + store float %3, float* %retval, align 4 + br label %return + +return: ; preds = %entry + %retval1 = load float* %retval ; [#uses=1] + ret float %retval1 +} + +define float @test4() nounwind { +entry: + %retval = alloca float ; [#uses=2] + %0 = alloca float ; [#uses=2] + %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] + %1 = call double @fmod(double -1.000000e-01, double -1.000000e+00) nounwind readonly ; [#uses=1] + %2 = fptrunc double %1 to float ; [#uses=1] + store float %2, float* %0, align 4 + %3 = load float* %0, align 4 ; [#uses=1] + store float %3, float* %retval, align 4 + br label %return + +return: ; preds = %entry + %retval1 = load float* %retval ; [#uses=1] + ret float %retval1 +}