1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt < %s --data-layout "e" -passes=dse -enable-dse-partial-store-merging=true -S | FileCheck %s
3 ; RUN: opt < %s --data-layout "E" -passes=dse -enable-dse-partial-store-merging=true -S | FileCheck %s
5 ; This test used to hit an assertion (see PR41949).
7 ; Better safe than sorry, do not assume anything about the padding for the
8 ; i28 store that has 32 bits as store size.
9 define void @test1(ptr %p) {
10 ; CHECK-LABEL: @test1(
11 ; CHECK-NEXT: [[A:%.*]] = alloca i32
12 ; CHECK-NEXT: [[C1:%.*]] = getelementptr inbounds { i16, i16 }, ptr [[A]], i32 0, i32 1
13 ; CHECK-NEXT: store i28 10, ptr [[A]]
14 ; CHECK-NEXT: store i16 20, ptr [[C1]]
15 ; CHECK-NEXT: call void @test1(ptr [[A]])
16 ; CHECK-NEXT: ret void
19 %c1 = getelementptr inbounds { i16, i16 }, ptr %a, i32 0, i32 1
23 call void @test1(ptr %a)
28 ; This test used to mis-compile (see PR41949).
30 ; Better safe than sorry, do not assume anything about the padding for the
31 ; i12 store that has 16 bits as store size.
32 define void @test2(ptr %p) {
33 ; CHECK-LABEL: @test2(
34 ; CHECK-NEXT: [[U:%.*]] = alloca i32
35 ; CHECK-NEXT: store i32 -1, ptr [[U]]
36 ; CHECK-NEXT: store i12 20, ptr [[U]]
37 ; CHECK-NEXT: call void @test2(ptr [[U]])
38 ; CHECK-NEXT: ret void
44 call void @test2(ptr %u)