aboutsummaryrefslogtreecommitdiffstats
path: root/test/Transforms/DeadStoreElimination/PartialStore.ll
diff options
context:
space:
mode:
Diffstat (limited to 'test/Transforms/DeadStoreElimination/PartialStore.ll')
-rw-r--r--test/Transforms/DeadStoreElimination/PartialStore.ll22
1 files changed, 19 insertions, 3 deletions
diff --git a/test/Transforms/DeadStoreElimination/PartialStore.ll b/test/Transforms/DeadStoreElimination/PartialStore.ll
index 4799ef3..80c2bfa 100644
--- a/test/Transforms/DeadStoreElimination/PartialStore.ll
+++ b/test/Transforms/DeadStoreElimination/PartialStore.ll
@@ -45,9 +45,9 @@ define void @test4(i8* %P) {
store i8 19, i8* %P ;; dead
%A = getelementptr i8* %P, i32 3
-
+
store i8 42, i8* %A ;; dead
-
+
%Q = bitcast i8* %P to double*
store double 0.0, double* %Q
ret void
@@ -61,7 +61,7 @@ define void @test5(i32 %i) nounwind ssp {
%C = getelementptr i8* %B, i32 %i
store i8 10, i8* %C ;; Dead store to variable index.
store i32 20, i32* %A
-
+
call void @test5a(i32* %A)
ret void
; CHECK-LABEL: @test5(
@@ -69,3 +69,19 @@ define void @test5(i32 %i) nounwind ssp {
; CHECK-NEXT: store i32 20
; CHECK-NEXT: call void @test5a
}
+
+declare void @test5a_as1(i32*)
+define void @test5_addrspacecast(i32 %i) nounwind ssp {
+ %A = alloca i32
+ %B = addrspacecast i32* %A to i8 addrspace(1)*
+ %C = getelementptr i8 addrspace(1)* %B, i32 %i
+ store i8 10, i8 addrspace(1)* %C ;; Dead store to variable index.
+ store i32 20, i32* %A
+
+ call void @test5a(i32* %A)
+ ret void
+; CHECK-LABEL: @test5_addrspacecast(
+; CHECK-NEXT: alloca
+; CHECK-NEXT: store i32 20
+; CHECK-NEXT: call void @test5a
+}