1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt %s -passes='scalarizer,dce' -S -scalarize-load-store -o - | FileCheck %s
4 ; This used to crash because the same (pointer) value was scattered by
7 define void @test1(ptr %p) {
9 ; CHECK-NEXT: [[P_I11:%.*]] = getelementptr i16, ptr [[P:%.*]], i32 1
10 ; CHECK-NEXT: [[P_I2:%.*]] = getelementptr i32, ptr [[P]], i32 2
11 ; CHECK-NEXT: [[P_I3:%.*]] = getelementptr i32, ptr [[P]], i32 3
12 ; CHECK-NEXT: store i32 0, ptr [[P]], align 8
13 ; CHECK-NEXT: [[P_I1:%.*]] = getelementptr i32, ptr [[P]], i32 1
14 ; CHECK-NEXT: store i32 0, ptr [[P_I1]], align 4
15 ; CHECK-NEXT: store i32 0, ptr [[P]], align 16
16 ; CHECK-NEXT: store i32 0, ptr [[P_I1]], align 4
17 ; CHECK-NEXT: store i32 0, ptr [[P_I2]], align 8
18 ; CHECK-NEXT: store i32 0, ptr [[P_I3]], align 4
19 ; CHECK-NEXT: store i16 0, ptr [[P]], align 4
20 ; CHECK-NEXT: store i16 0, ptr [[P_I11]], align 2
21 ; CHECK-NEXT: ret void
23 store <2 x i32> zeroinitializer, ptr %p
24 store <4 x i32> zeroinitializer, ptr %p
25 store <2 x i16> zeroinitializer, ptr %p