1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2; RUN: opt < %s -gvn -S | FileCheck %s
3; RUN: opt < %s -passes=gvn -S | FileCheck %s
4
5define i32 addrspace(1)* @addrspacecast(i32* %ptr) {
6; CHECK-LABEL: @addrspacecast(
7; CHECK-NEXT:  block1:
8; CHECK-NEXT:    [[Z1:%.*]] = addrspacecast i32* [[PTR:%.*]] to i32 addrspace(1)*
9; CHECK-NEXT:    store i32 addrspace(1)* [[Z1]], i32 addrspace(1)** undef
10; CHECK-NEXT:    ret i32 addrspace(1)* [[Z1]]
11;
12block1:
13  %z1 = addrspacecast i32* %ptr to i32 addrspace(1)*
14  store i32 addrspace(1)* %z1, i32 addrspace(1)** undef
15  br label %block2
16
17block2:
18  %z2 = addrspacecast i32* %ptr to i32 addrspace(1)*
19  ret i32 addrspace(1)* %z2
20}
21