xref: /llvm-project/llvm/test/Transforms/Util/Debugify/loc-only.ll (revision 094572701dce4aaf36f4521d6cf750420d39f206)
1; RUN: opt -passes=debugify -S < %s | FileCheck --check-prefixes=ALL,VALUE %s
2; RUN: opt -passes=debugify -debugify-level=locations -S < %s | FileCheck --check-prefixes=ALL --implicit-check-not=dbg.value %s
3
4; RUN: opt -passes=debugify -S < %s --try-experimental-debuginfo-iterators | FileCheck --check-prefixes=ALL,VALUE %s
5
6; ALL-LABEL: @test
7define void @test() {
8  %add = add i32 1, 2
9; ALL-NEXT:  %add = add i32 1, 2, !dbg [[L1:![0-9]+]]
10; VALUE-NEXT: #dbg_value(i32 %add, [[add:![0-9]+]], !DIExpression(), [[L1]]
11  %sub = sub i32 %add, 1
12; ALL-NEXT: %sub = sub i32 %add, 1, !dbg [[L2:![0-9]+]]
13; VALUE-NEXT: #dbg_value(i32 %sub, [[sub:![0-9]+]], !DIExpression(), [[L2]]
14; ALL-NEXT: ret void, !dbg [[L3:![0-9]+]]
15  ret void
16}
17
18; VALUE: [[add]] = !DILocalVariable
19; VALUE: [[sub]] = !DILocalVariable
20
21; ALL: [[L1]] = !DILocation(line: 1, column: 1, scope:
22; ALL: [[L2]] = !DILocation(line: 2, column: 1, scope:
23; ALL: [[L3]] = !DILocation(line: 3, column: 1, scope:
24