diff options
Diffstat (limited to 'test/Transforms/ConstProp')
-rw-r--r-- | test/Transforms/ConstProp/InsertElement.ll | 12 | ||||
-rw-r--r-- | test/Transforms/ConstProp/insertvalue.ll | 9 |
2 files changed, 21 insertions, 0 deletions
diff --git a/test/Transforms/ConstProp/InsertElement.ll b/test/Transforms/ConstProp/InsertElement.ll new file mode 100644 index 0000000..d249c2e --- /dev/null +++ b/test/Transforms/ConstProp/InsertElement.ll @@ -0,0 +1,12 @@ +; RUN: opt < %s -constprop -S | FileCheck %s + +define i32 @test1() { + %A = bitcast i32 2139171423 to float + %B = insertelement <1 x float> undef, float %A, i32 0 + %C = extractelement <1 x float> %B, i32 0 + %D = bitcast float %C to i32 + ret i32 %D +; CHECK: @test1 +; CHECK: ret i32 2139171423 +} + diff --git a/test/Transforms/ConstProp/insertvalue.ll b/test/Transforms/ConstProp/insertvalue.ll index 0d288b3..dce2b72 100644 --- a/test/Transforms/ConstProp/insertvalue.ll +++ b/test/Transforms/ConstProp/insertvalue.ll @@ -65,3 +65,12 @@ define [3 x %struct] @undef-test3() { ; CHECK: ret [3 x %struct] [%struct undef, %struct { i32 0, [4 x i8] undef }, %struct undef] } +define i32 @test-float-Nan() { + %A = bitcast i32 2139171423 to float + %B = insertvalue [1 x float] undef, float %A, 0 + %C = extractvalue [1 x float] %B, 0 + %D = bitcast float %C to i32 + ret i32 %D +; CHECK: @test-float-Nan +; CHECK: ret i32 2139171423 +} |