2015-11-06 01:19:59 +08:00
|
|
|
; RUN: llc < %s -mtriple=i686-pc-linux -relocation-model=pic | FileCheck %s
|
|
|
|
|
|
|
|
target datalayout = "e-m:e-p:32:32-f64:32:64-f80:32-n8:16:32-S128"
|
|
|
|
target triple = "i686-pc-linux"
|
|
|
|
|
|
|
|
; Function Attrs: nounwind
|
2015-11-06 06:03:56 +08:00
|
|
|
define void @test() #0 !dbg !4 {
|
2015-11-06 01:19:59 +08:00
|
|
|
entry:
|
|
|
|
call void bitcast (void (...)* @bar to void ()*)(), !dbg !11
|
|
|
|
ret void, !dbg !12
|
|
|
|
}
|
|
|
|
|
|
|
|
declare void @bar(...) #1
|
|
|
|
|
|
|
|
attributes #0 = { nounwind "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="i686" "unsafe-fp-math"="false" "use-soft-float"="false" }
|
|
|
|
attributes #1 = { "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="i686" "unsafe-fp-math"="false" "use-soft-float"="false" }
|
|
|
|
|
|
|
|
!llvm.dbg.cu = !{!0}
|
|
|
|
!llvm.module.flags = !{!7, !8, !9}
|
|
|
|
!llvm.ident = !{!10}
|
|
|
|
|
2016-04-15 23:57:41 +08:00
|
|
|
!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.8.0 (http://llvm.org/git/clang.git 3490ab8630d5643f71f1f04e46984f05b27b8d67) (http://llvm.org/git/llvm.git d2643e2ff955ed234944fe3c6b4ffc1250085843)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
|
2015-11-06 01:19:59 +08:00
|
|
|
!1 = !DIFile(filename: "test.c", directory: "movpc-test")
|
|
|
|
!2 = !{}
|
[DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label.
In order to set breakpoints on labels and list source code around
labels, we need collect debug information for labels, i.e., label
name, the function label belong, line number in the file, and the
address label located. In order to keep these information in LLVM
IR and to allow backend to generate debug information correctly.
We create a new kind of metadata for labels, DILabel. The format
of DILabel is
!DILabel(scope: !1, name: "foo", file: !2, line: 3)
We hope to keep debug information as much as possible even the
code is optimized. So, we create a new kind of intrinsic for label
metadata to avoid the metadata is eliminated with basic block.
The intrinsic will keep existing if we keep it from optimized out.
The format of the intrinsic is
llvm.dbg.label(metadata !1)
It has only one argument, that is the DILabel metadata. The
intrinsic will follow the label immediately. Backend could get the
label metadata through the intrinsic's parameter.
We also create DIBuilder API for labels to be used by Frontend.
Frontend could use createLabel() to allocate DILabel objects, and use
insertLabel() to insert llvm.dbg.label intrinsic in LLVM IR.
Differential Revision: https://reviews.llvm.org/D45024
Patch by Hsiangkai Wang.
llvm-svn: 331841
2018-05-09 10:40:45 +08:00
|
|
|
!4 = distinct !DISubprogram(name: "test", scope: !1, file: !1, line: 2, type: !5, isLocal: false, isDefinition: true, scopeLine: 3, isOptimized: false, unit: !0, retainedNodes: !2)
|
2015-11-06 01:19:59 +08:00
|
|
|
!5 = !DISubroutineType(types: !6)
|
|
|
|
!6 = !{null}
|
|
|
|
!7 = !{i32 2, !"Dwarf Version", i32 4}
|
|
|
|
!8 = !{i32 2, !"Debug Info Version", i32 3}
|
|
|
|
!9 = !{i32 1, !"PIC Level", i32 2}
|
|
|
|
!10 = !{!"clang version 3.8.0 (http://llvm.org/git/clang.git 3490ab8630d5643f71f1f04e46984f05b27b8d67) (http://llvm.org/git/llvm.git d2643e2ff955ed234944fe3c6b4ffc1250085843)"}
|
|
|
|
!11 = !DILocation(line: 4, column: 3, scope: !4)
|
|
|
|
!12 = !DILocation(line: 5, column: 1, scope: !4)
|
|
|
|
|
|
|
|
; CHECK: calll .L0$pb
|
|
|
|
; CHECK-NEXT: .cfi_adjust_cfa_offset 4
|
|
|
|
; CHECK-NEXT: .L0$pb:
|
|
|
|
; CHECK-NEXT: popl
|
|
|
|
; CHECK-NEXT: .cfi_adjust_cfa_offset -4
|