2015-04-17 00:27:54 +02:00
|
|
|
; RUN: llc -filetype=obj -o %t.o %s
|
|
|
|
; RUN: llvm-dwarfdump -debug-dump=info %t.o | FileCheck %s
|
|
|
|
|
2015-04-17 02:18:46 +02:00
|
|
|
; Testcase generated using 'clang -g -O2 -S -emit-llvm' from the following:
|
2015-04-17 02:37:53 +02:00
|
|
|
;; void sink(void);
|
2015-04-17 02:18:46 +02:00
|
|
|
;; static __attribute__((always_inline)) void bar(int a) { sink(); }
|
2015-04-17 02:37:53 +02:00
|
|
|
;; void foo(void) {
|
2015-04-17 02:18:46 +02:00
|
|
|
;; bar(0);
|
|
|
|
;; bar(0);
|
2015-04-17 00:27:54 +02:00
|
|
|
;; }
|
|
|
|
|
2015-04-17 02:18:46 +02:00
|
|
|
; Check that we have formal parameters for 'a' in both inlined subroutines.
|
|
|
|
; CHECK: DW_TAG_inlined_subroutine
|
|
|
|
; CHECK-NEXT: DW_AT_abstract_origin {{.*}} "bar"
|
|
|
|
; CHECK: DW_TAG_formal_parameter
|
|
|
|
; CHECK-NEXT: DW_AT_const_value
|
|
|
|
; CHECK-NEXT: DW_AT_abstract_origin {{.*}} "a"
|
2015-04-17 00:27:54 +02:00
|
|
|
; CHECK: DW_TAG_inlined_subroutine
|
2015-04-17 02:18:46 +02:00
|
|
|
; CHECK-NEXT: DW_AT_abstract_origin {{.*}} "bar"
|
2015-04-17 00:27:54 +02:00
|
|
|
; CHECK: DW_TAG_formal_parameter
|
|
|
|
; CHECK-NEXT: DW_AT_const_value
|
|
|
|
; CHECK-NEXT: DW_AT_abstract_origin {{.*}} "a"
|
|
|
|
|
|
|
|
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
|
|
|
|
target triple = "x86_64-apple-darwin"
|
|
|
|
|
|
|
|
; Function Attrs: nounwind ssp uwtable
|
2015-11-05 23:03:56 +01:00
|
|
|
define void @foo() #0 !dbg !4 {
|
2015-04-17 00:27:54 +02:00
|
|
|
entry:
|
2015-04-17 02:18:46 +02:00
|
|
|
tail call void @llvm.dbg.value(metadata i32 0, i64 0, metadata !12, metadata !17) #3, !dbg !18
|
2015-04-17 02:37:53 +02:00
|
|
|
tail call void @sink() #3, !dbg !20
|
2015-04-17 02:18:46 +02:00
|
|
|
tail call void @llvm.dbg.value(metadata i32 0, i64 0, metadata !12, metadata !17) #3, !dbg !21
|
2015-04-17 02:37:53 +02:00
|
|
|
tail call void @sink() #3, !dbg !23
|
2015-04-17 02:18:46 +02:00
|
|
|
ret void, !dbg !24
|
2015-04-17 00:27:54 +02:00
|
|
|
}
|
|
|
|
|
2015-04-17 02:37:53 +02:00
|
|
|
declare void @sink() #1
|
2015-04-17 00:27:54 +02:00
|
|
|
|
2015-04-17 02:18:46 +02:00
|
|
|
; Function Attrs: nounwind readnone
|
|
|
|
declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #2
|
2015-04-17 00:27:54 +02:00
|
|
|
|
|
|
|
attributes #0 = { nounwind ssp uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="core2" "unsafe-fp-math"="false" "use-soft-float"="false" }
|
2015-04-17 02:18:46 +02:00
|
|
|
attributes #1 = { "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="core2" "unsafe-fp-math"="false" "use-soft-float"="false" }
|
|
|
|
attributes #2 = { nounwind readnone }
|
|
|
|
attributes #3 = { nounwind }
|
2015-04-17 00:27:54 +02:00
|
|
|
|
|
|
|
!llvm.dbg.cu = !{!0}
|
2015-04-17 02:18:46 +02:00
|
|
|
!llvm.module.flags = !{!13, !14, !15}
|
|
|
|
!llvm.ident = !{!16}
|
2015-04-17 00:27:54 +02:00
|
|
|
|
2015-08-03 19:26:41 +02:00
|
|
|
!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.7.0 (trunk 235110) (llvm/trunk 235108)", isOptimized: true, runtimeVersion: 0, emissionKind: 1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2)
|
2015-04-29 18:38:44 +02:00
|
|
|
!1 = !DIFile(filename: "t.c", directory: "/path/to/dir")
|
2015-04-17 00:27:54 +02:00
|
|
|
!2 = !{}
|
2015-04-17 02:18:46 +02:00
|
|
|
!3 = !{!4, !7}
|
2015-11-05 23:03:56 +01:00
|
|
|
!4 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 3, type: !5, isLocal: false, isDefinition: true, scopeLine: 3, flags: DIFlagPrototyped, isOptimized: true, variables: !2)
|
2015-04-29 18:38:44 +02:00
|
|
|
!5 = !DISubroutineType(types: !6)
|
2015-04-17 02:18:46 +02:00
|
|
|
!6 = !{null}
|
2015-08-28 22:26:49 +02:00
|
|
|
!7 = distinct !DISubprogram(name: "bar", scope: !1, file: !1, line: 2, type: !8, isLocal: true, isDefinition: true, scopeLine: 2, flags: DIFlagPrototyped, isOptimized: true, variables: !11)
|
2015-04-29 18:38:44 +02:00
|
|
|
!8 = !DISubroutineType(types: !9)
|
2015-04-17 02:18:46 +02:00
|
|
|
!9 = !{null, !10}
|
2015-04-29 18:38:44 +02:00
|
|
|
!10 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
|
2015-04-17 02:18:46 +02:00
|
|
|
!11 = !{!12}
|
2015-07-31 20:58:39 +02:00
|
|
|
!12 = !DILocalVariable(name: "a", arg: 1, scope: !7, file: !1, line: 2, type: !10)
|
2015-04-17 02:18:46 +02:00
|
|
|
!13 = !{i32 2, !"Dwarf Version", i32 2}
|
|
|
|
!14 = !{i32 2, !"Debug Info Version", i32 3}
|
|
|
|
!15 = !{i32 1, !"PIC Level", i32 2}
|
|
|
|
!16 = !{!"clang version 3.7.0 (trunk 235110) (llvm/trunk 235108)"}
|
2015-04-29 18:38:44 +02:00
|
|
|
!17 = !DIExpression()
|
|
|
|
!18 = !DILocation(line: 2, column: 52, scope: !7, inlinedAt: !19)
|
|
|
|
!19 = distinct !DILocation(line: 4, column: 3, scope: !4)
|
|
|
|
!20 = !DILocation(line: 2, column: 57, scope: !7, inlinedAt: !19)
|
|
|
|
!21 = !DILocation(line: 2, column: 52, scope: !7, inlinedAt: !22)
|
|
|
|
!22 = distinct !DILocation(line: 5, column: 3, scope: !4)
|
|
|
|
!23 = !DILocation(line: 2, column: 57, scope: !7, inlinedAt: !22)
|
|
|
|
!24 = !DILocation(line: 6, column: 1, scope: !4)
|