| 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 -O0 -filetype=obj %t.ll -o - | 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 |
; // S is not trivially copyable. |
| 13 |
; struct S { |
| 14 |
; ~S() {} |
| 15 |
; }; |
| 16 |
; |
| 17 |
; // T is a POD. |
| 18 |
; struct T { |
| 19 |
; ~T() = default; |
| 20 |
; }; |
| 21 |
; |
| 22 |
; S s; |
| 23 |
; T t; |
| 24 |
; |
| 25 |
; CHECK: DW_TAG_structure_type |
| 26 |
; CHECK-NEXT: DW_AT_calling_convention {{.*}} (DW_CC_pass_by_reference) |
| 27 |
; CHECK-NEXT: DW_AT_name {{.*}} "S" |
| 28 |
; |
| 29 |
; CHECK: DW_TAG_structure_type |
| 30 |
; CHECK-NEXT: DW_AT_calling_convention {{.*}} (DW_CC_pass_by_value) |
| 31 |
; CHECK-NEXT: DW_AT_name {{.*}} "T" |
| 32 |
|
| 33 |
%struct.S = type { i8 } |
| 34 |
%struct.T = type { i8 } |
| 35 |
|
| 36 |
@s = global %struct.S zeroinitializer, align 1, !dbg !0 |
| 37 |
@__dso_handle = external hidden global i8 |
| 38 |
@t = global %struct.T zeroinitializer, align 1, !dbg !6 |
| 39 |
|
| 40 |
!llvm.dbg.cu = !{!2} |
| 41 |
!llvm.module.flags = !{!20, !21, !22, !23} |
| 42 |
!llvm.ident = !{!24} |
| 43 |
|
| 44 |
!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression()) |
| 45 |
!1 = distinct !DIGlobalVariable(name: "s", scope: !2, file: !3, line: 9, type: !14, isLocal: false, isDefinition: true) |
| 46 |
!2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !3, producer: "clang version 7.0.0 (trunk 321763) (llvm/trunk 321758)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5) |
| 47 |
!3 = !DIFile(filename: "pass.cpp", directory: "/") |
| 48 |
!4 = !{} |
| 49 |
!5 = !{!0, !6} |
| 50 |
!6 = !DIGlobalVariableExpression(var: !7, expr: !DIExpression()) |
| 51 |
!7 = distinct !DIGlobalVariable(name: "t", scope: !2, file: !3, line: 10, type: !8, isLocal: false, isDefinition: true) |
| 52 |
!8 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "T", file: !3, line: 5, size: 8, elements: !9, identifier: "_ZTS1T", flags: DIFlagTypePassByValue) |
| 53 |
!9 = !{!10} |
| 54 |
!10 = !DISubprogram(name: "~T", scope: !8, file: !3, line: 6, type: !11, isLocal: false, isDefinition: false, scopeLine: 6, flags: DIFlagPrototyped, isOptimized: false) |
| 55 |
!11 = !DISubroutineType(types: !12) |
| 56 |
!12 = !{null, !13} |
| 57 |
!13 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !8, size: 64, flags: DIFlagArtificial | DIFlagObjectPointer) |
| 58 |
!14 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "S", file: !3, line: 1, size: 8, elements: !15, identifier: "_ZTS1S", flags: DIFlagTypePassByReference) |
| 59 |
!15 = !{!16} |
| 60 |
!16 = !DISubprogram(name: "~S", scope: !14, file: !3, line: 2, type: !17, isLocal: false, isDefinition: false, scopeLine: 2, flags: DIFlagPrototyped, isOptimized: false) |
| 61 |
!17 = !DISubroutineType(types: !18) |
| 62 |
!18 = !{null, !19} |
| 63 |
!19 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !14, size: 64, flags: DIFlagArtificial | DIFlagObjectPointer) |
| 64 |
!20 = !{i32 2, !"Dwarf Version", i32 4} |
| 65 |
!21 = !{i32 2, !"Debug Info Version", i32 3} |
| 66 |
!22 = !{i32 1, !"wchar_size", i32 4} |
| 67 |
!23 = !{i32 7, !"PIC Level", i32 2} |
| 68 |
!24 = !{!"clang version 7.0.0 (trunk 321763) (llvm/trunk 321758)"} |