xref: /llvm-project/llvm/test/CodeGen/PowerPC/combine-to-pre-index-store-crash.ll (revision 427fb35192f1f7bb694a5910b05abc5925a798b2)
1; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu < %s | FileCheck %s
2
3; CHECK-LABEL: TestFoo:
4; CHECK: std
5; CHECK: bl TestBar
6; CHECK: stbu
7; CHECK: std
8; CHECK: blr
9
10%StructA = type <{ i64, { i64, i64 }, { i64, i64 } }>
11
12define void @TestFoo(ptr %this) {
13  %tmp = getelementptr inbounds %StructA, ptr %this, i64 0, i32 1
14  %tmp11 = getelementptr inbounds %StructA, ptr %this, i64 0, i32 1, i32 1
15  store ptr %tmp11, ptr %tmp
16  call void @TestBar()
17  %tmp13 = getelementptr inbounds %StructA, ptr %this, i64 0, i32 2, i32 1
18  store ptr %tmp13, ptr undef
19  store i8 0, ptr %tmp13
20  ret void
21}
22
23declare void @TestBar()
24