| 1 |
; REQUIRES: object-emission |
| 2 |
|
| 3 |
; RUN: llvm-as < %s -o %t.bc |
| 4 |
; RUN: llvm-spirv %t.bc -o %t.spv |
| 5 |
; RUN: llvm-spirv -r -emit-opaque-pointers %t.spv -o - | llvm-dis -o %t.ll |
| 6 |
|
| 7 |
; RUN: llc -mtriple=%triple -filetype=obj -O0 < %t.ll | llvm-dwarfdump -v -debug-info - | FileCheck %s |
| 8 |
|
| 9 |
target datalayout = "e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-n8:16:32:64" |
| 10 |
target triple = "spir64-unknown-unknown" |
| 11 |
|
| 12 |
; generated by clang from: |
| 13 |
; struct foo { |
| 14 |
; void f1(); |
| 15 |
; void f2(); |
| 16 |
; }; |
| 17 |
; |
| 18 |
; void foo::f1() { |
| 19 |
; } |
| 20 |
|
| 21 |
; CHECK: DW_TAG_structure_type |
| 22 |
; CHECK-NEXT: DW_AT_name {{.*}} "foo" |
| 23 |
; CHECK-NOT: NULL |
| 24 |
; CHECK: DW_TAG_subprogram |
| 25 |
; CHECK-NOT: NULL |
| 26 |
; CHECK: DW_AT_name {{.*}} "f1" |
| 27 |
; CHECK: DW_TAG_subprogram |
| 28 |
; CHECK-NOT: NULL |
| 29 |
; CHECK: DW_AT_name {{.*}} "f2" |
| 30 |
|
| 31 |
|
| 32 |
%struct.foo = type { i8 } |
| 33 |
|
| 34 |
; Function Attrs: nounwind uwtable |
| 35 |
define void @_ZN3foo2f1Ev(%struct.foo* %this) #0 align 2 !dbg !14 { |
| 36 |
entry: |
| 37 |
%this.addr = alloca %struct.foo*, align 8 |
| 38 |
store %struct.foo* %this, %struct.foo** %this.addr, align 8 |
| 39 |
call void @llvm.dbg.declare(metadata %struct.foo** %this.addr, metadata !16, metadata !DIExpression()), !dbg !18 |
| 40 |
%this1 = load %struct.foo*, %struct.foo** %this.addr |
| 41 |
ret void, !dbg !19 |
| 42 |
} |
| 43 |
|
| 44 |
; Function Attrs: nounwind readnone |
| 45 |
declare void @llvm.dbg.declare(metadata, metadata, metadata) #1 |
| 46 |
|
| 47 |
attributes #0 = { nounwind 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" "unsafe-fp-math"="false" "use-soft-float"="false" } |
| 48 |
attributes #1 = { nounwind readnone } |
| 49 |
|
| 50 |
!llvm.dbg.cu = !{!0} |
| 51 |
!llvm.module.flags = !{!15, !20} |
| 52 |
|
| 53 |
!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.4 ", isOptimized: false, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !3, globals: !2, imports: !2) |
| 54 |
!1 = !DIFile(filename: "member-order.cpp", directory: "/tmp/dbginfo") |
| 55 |
!2 = !{} |
| 56 |
!3 = !{!4} |
| 57 |
!4 = !DICompositeType(tag: DW_TAG_structure_type, name: "foo", line: 1, size: 8, align: 8, file: !1, elements: !5, identifier: "_ZTS3foo") |
| 58 |
!5 = !{!6, !11} |
| 59 |
!6 = !DISubprogram(name: "f1", linkageName: "_ZN3foo2f1Ev", line: 2, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 2, file: !1, scope: !4, type: !7) |
| 60 |
!7 = !DISubroutineType(types: !8) |
| 61 |
!8 = !{null, !9} |
| 62 |
!9 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !4) |
| 63 |
!10 = !{i32 786468} |
| 64 |
!11 = !DISubprogram(name: "f2", linkageName: "_ZN3foo2f2Ev", line: 3, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !1, scope: !4, type: !7) |
| 65 |
!12 = !{i32 786468} |
| 66 |
!14 = distinct !DISubprogram(name: "f1", linkageName: "_ZN3foo2f1Ev", line: 6, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 6, file: !1, scope: null, type: !7, declaration: !6, retainedNodes: !2) |
| 67 |
!15 = !{i32 2, !"Dwarf Version", i32 4} |
| 68 |
!16 = !DILocalVariable(name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !14, type: !17) |
| 69 |
!17 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !4) |
| 70 |
!18 = !DILocation(line: 0, scope: !14) |
| 71 |
!19 = !DILocation(line: 7, scope: !14) |
| 72 |
!20 = !{i32 1, !"Debug Info Version", i32 3} |