aboutsummaryrefslogtreecommitdiff
path: root/llvm/test/CodeGen/LoongArch/ldx-stx-sp-2.ll
blob: b5c9d1e7ff0f99e03cac734f2ea3b00624d90562 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
; RUN: llc --mtriple=loongarch32 -mattr=+d < %s
; RUN: llc --mtriple=loongarch64 -mattr=+d < %s

;; This should not crash the code generator.

@.str.2 = external dso_local unnamed_addr constant [69 x i8], align 1

define dso_local void @main() {
entry:
  %n0 = alloca [2 x [3 x i32]], align 4
  %0 = load i32, ptr poison, align 4
  %idxprom15 = sext i32 %0 to i64
  %arrayidx16 = getelementptr inbounds [2 x [3 x i32]], ptr %n0, i64 0, i64 %idxprom15
  %arrayidx17 = getelementptr inbounds [3 x i32], ptr %arrayidx16, i64 0, i64 0
  %1 = load i32, ptr %arrayidx17, align 4
  call void (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef signext %1)
  ret void
}

declare void @printf(ptr, ...)