xref: /llvm-project/llvm/test/CodeGen/Generic/MIRDebugify/check-line-and-variables.ll (revision 1c6b0f779f66494cb597884c1a52e377bde4bc54)
1; RUN: llc -debugify-check-and-strip-all-safe -o - %s 2>&1 | FileCheck %s
2; RUN: llc --experimental-debuginfo-iterators=false -debugify-check-and-strip-all-safe -o - %s 2>&1 | FileCheck %s
3
4; ModuleID = 'main.c'
5source_filename = "main.c"
6
7@ga = dso_local global i32 2, align 4
8
9define dso_local i32 @foo(i32 %a, i32 %b) {
10entry:
11  %a.addr = alloca i32, align 4
12  %b.addr = alloca i32, align 4
13  %c = alloca i32, align 4
14  store i32 %a, ptr %a.addr, align 4
15  store i32 %b, ptr %b.addr, align 4
16  %0 = load i32, ptr %a.addr, align 4
17  %1 = load i32, ptr %b.addr, align 4
18  %add = add nsw i32 %0, %1
19  store i32 %add, ptr %c, align 4
20  %2 = load i32, ptr %c, align 4
21  %mul = mul nsw i32 %2, 2
22  store i32 %mul, ptr @ga, align 4
23  %3 = load i32, ptr %c, align 4
24  ret i32 %3
25}
26
27; Different Back-Ends may have different number of passes, here we only
28; check two of them to make sure -debugify-check-and-strip-all-safe works.
29;CHECK: Machine IR debug info check: PASS
30;CHECK: Machine IR debug info check: PASS
31