• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: opt -debugify -S < %s | FileCheck --check-prefixes=ALL,VALUE %s
2; RUN: opt -debugify -debugify-level=locations -S < %s | FileCheck --check-prefixes=ALL --implicit-check-not=dbg.value %s
3
4; ALL-LABEL: @test
5define void @test() {
6  %add = add i32 1, 2
7; ALL-NEXT:  %add = add i32 1, 2, !dbg [[L1:![0-9]+]]
8; VALUE-NEXT: call void @llvm.dbg.value(metadata i32 %add, metadata [[add:![0-9]+]], metadata !DIExpression()), !dbg [[L1]]
9  %sub = sub i32 %add, 1
10; ALL-NEXT: %sub = sub i32 %add, 1, !dbg [[L2:![0-9]+]]
11; VALUE-NEXT: call void @llvm.dbg.value(metadata i32 %sub, metadata [[sub:![0-9]+]], metadata !DIExpression()), !dbg [[L2]]
12; ALL-NEXT: ret void, !dbg [[L3:![0-9]+]]
13  ret void
14}
15
16; VALUE: [[add]] = !DILocalVariable
17; VALUE: [[sub]] = !DILocalVariable
18
19; ALL: [[L1]] = !DILocation(line: 1, column: 1, scope:
20; ALL: [[L2]] = !DILocation(line: 2, column: 1, scope:
21; ALL: [[L3]] = !DILocation(line: 3, column: 1, scope:
22