| 1 |
; RUN: llvm-as < %s -o %t.bc |
| 2 |
; RUN: llvm-spirv %t.bc -o %t.spv -spirv-debug-info-version=nonsemantic-shader-100 |
| 3 |
; RUN: llvm-spirv %t.spv --to-text -o - | FileCheck %s --check-prefix=CHECK-SPIRV |
| 4 |
; RUN: llvm-spirv -r %t.spv -o %t.rev.bc |
| 5 |
; RUN: llvm-dis < %t.rev.bc | FileCheck %s --check-prefix=CHECK-LLVM |
| 6 |
|
| 7 |
; RUN: llvm-spirv %t.bc -o %t.spv -spirv-debug-info-version=nonsemantic-shader-200 |
| 8 |
; RUN: llvm-spirv %t.spv --to-text -o - | FileCheck %s --check-prefix=CHECK-SPIRV |
| 9 |
; RUN: llvm-spirv -r %t.spv -o %t.rev.bc |
| 10 |
; RUN: llvm-dis < %t.rev.bc | FileCheck %s --check-prefix=CHECK-LLVM |
| 11 |
|
| 12 |
; Generated from: |
| 13 |
; |
| 14 |
; struct A { |
| 15 |
; static int fully_specified; |
| 16 |
; static int smem[]; |
| 17 |
; }; |
| 18 |
; |
| 19 |
; int A::fully_specified; |
| 20 |
; int A::smem[] = { 0, 1, 2, 3 }; |
| 21 |
|
| 22 |
; CHECK-SPIRV: ExtInst [[#]] [[#Member1:]] [[#]] DebugTypeMember [[#]] [[#]] [[#]] [[#]] [[#]] [[#]] [[#]] [[#]] {{$}} |
| 23 |
; CHECK-SPIRV: ExtInst [[#]] [[#Member2:]] [[#]] DebugTypeMember [[#]] [[#]] [[#]] [[#]] [[#]] [[#]] [[#]] [[#]] {{$}} |
| 24 |
; CHECK-SPIRV: ExtInst [[#]] [[#]] [[#]] DebugTypeComposite [[#]] [[#]] [[#]] [[#]] [[#]] [[#]] [[#]] [[#]] [[#]] [[#Member1]] [[#Member2]] |
| 25 |
; CHECK-SPIRV: ExtInst [[#]] [[#]] [[#]] DebugGlobalVariable [[#]] [[#]] [[#]] [[#]] [[#]] [[#]] [[#]] [[#]] [[#]] [[#Member1]] |
| 26 |
; CHECK-SPIRV: ExtInst [[#]] [[#]] [[#]] DebugGlobalVariable [[#]] [[#]] [[#]] [[#]] [[#]] [[#]] [[#]] [[#]] [[#]] [[#Member2]] |
| 27 |
|
| 28 |
; CHECK-LLVM: ![[#GVExpr1:]] = !DIGlobalVariableExpression(var: ![[#GV1:]], expr: !DIExpression()) |
| 29 |
; CHECK-LLVM: ![[#GV1]] = distinct !DIGlobalVariable(name: "fully_specified", linkageName: "_ZN1A15fully_specifiedE", scope: ![[#CU:]], file: ![[#File:]], line: 7, type: ![[#GVTy1:]], isLocal: false, isDefinition: true, declaration: ![[#Decl1:]]) |
| 30 |
; CHECK-LLVM: ![[#CU]] = distinct !DICompileUnit(language: DW_LANG_C_plus_plus{{.*}}, file: ![[#File:]], {{.*}}, globals: ![[#GVs:]] |
| 31 |
; CHECK-LLVM: ![[#File]] = !DIFile(filename: "static_member_array.cpp", directory: "/Volumes/Data/radar/28706946") |
| 32 |
; CHECK-LLVM: ![[#GVs]] = !{![[#GVExpr1]], ![[#GVExpr2:]]} |
| 33 |
; CHECK-LLVM: ![[#GVExpr2]] = !DIGlobalVariableExpression(var: ![[#GV2:]], expr: !DIExpression()) |
| 34 |
; CHECK-LLVM: ![[#GV2]] = distinct !DIGlobalVariable(name: "smem", linkageName: "_ZN1A4smemE", scope: ![[#CU]], file: ![[#File]], line: 8, type: ![[#GVTy2:]], isLocal: false, isDefinition: true, declaration: ![[#Decl2:]]) |
| 35 |
; CHECK-LLVM: ![[#GVTy2]] = !DICompositeType(tag: DW_TAG_array_type, baseType: !8, size: 128, elements: ![[#Elements1:]]) |
| 36 |
; CHECK-LLVM: ![[#GVTy1]] = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) |
| 37 |
; CHECK-LLVM: ![[#Elements1]] = !{![[#Subrange:]]} |
| 38 |
; CHECK-LLVM: ![[#Subrange]] = !DISubrange(count: 4 |
| 39 |
; CHECK-LLVM: ![[#MemTy1:]] = !DIDerivedType(tag: DW_TAG_member, name: "smem", scope: ![[#StructTy:]], file: ![[#File]], line: 4, baseType: ![[#ArrTy:]], flags: DIFlagPublic | DIFlagStaticMember) |
| 40 |
; CHECK-LLVM: ![[#StructTy]] = !DICompositeType(tag: DW_TAG_structure_type, name: "A", file: ![[#File]], line: 1, size: 8, elements: ![[#Elements2:]], identifier: "_ZTS1A") |
| 41 |
; CHECK-LLVM: ![[#Elements2]] = !{![[#MemTy2:]], ![[#MemTy1]]} |
| 42 |
; CHECK-LLVM: ![[#MemTy2:]] = !DIDerivedType(tag: DW_TAG_member, name: "fully_specified", scope: ![[#StructTy]], file: ![[#File]], line: 3, baseType: ![[#GVTy1]], flags: DIFlagPublic | DIFlagStaticMember) |
| 43 |
; CHECK-LLVM: ![[#ArrTy]] = !DICompositeType(tag: DW_TAG_array_type, baseType: !8, elements: ![[#]]) |
| 44 |
|
| 45 |
|
| 46 |
source_filename = "static_member_array.cpp" |
| 47 |
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" |
| 48 |
target triple = "spir64-unknown-unknown" |
| 49 |
|
| 50 |
@_ZN1A15fully_specifiedE = global i32 0, align 4, !dbg !0 |
| 51 |
@_ZN1A4smemE = global [4 x i32] [i32 0, i32 1, i32 2, i32 3], align 16, !dbg !6 |
| 52 |
|
| 53 |
!llvm.dbg.cu = !{!2} |
| 54 |
!llvm.module.flags = !{!19, !20, !21} |
| 55 |
!llvm.ident = !{!22} |
| 56 |
|
| 57 |
!0 = distinct !DIGlobalVariableExpression(var: !1, expr: !DIExpression()) |
| 58 |
!1 = !DIGlobalVariable(name: "fully_specified", linkageName: "_ZN1A15fully_specifiedE", scope: !2, file: !3, line: 7, type: !9, isLocal: false, isDefinition: true, declaration: !15) |
| 59 |
!2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !3, producer: "clang version 4.0.0 (trunk 286129) (llvm/trunk 286128)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5) |
| 60 |
!3 = !DIFile(filename: "static_member_array.cpp", directory: "/Volumes/Data/radar/28706946") |
| 61 |
!4 = !{} |
| 62 |
!5 = !{!0, !6} |
| 63 |
!6 = distinct !DIGlobalVariableExpression(var: !7, expr: !DIExpression()) |
| 64 |
!7 = !DIGlobalVariable(name: "smem", linkageName: "_ZN1A4smemE", scope: !2, file: !3, line: 8, type: !8, isLocal: false, isDefinition: true, declaration: !12) |
| 65 |
!8 = !DICompositeType(tag: DW_TAG_array_type, baseType: !9, size: 128, elements: !10) |
| 66 |
!9 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) |
| 67 |
!10 = !{!11} |
| 68 |
!11 = !DISubrange(count: 4) |
| 69 |
!12 = !DIDerivedType(tag: DW_TAG_member, name: "smem", scope: !13, file: !3, line: 4, baseType: !16, flags: DIFlagStaticMember) |
| 70 |
!13 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "A", file: !3, line: 1, size: 8, elements: !14, identifier: "_ZTS1A") |
| 71 |
!14 = !{!15, !12} |
| 72 |
!15 = !DIDerivedType(tag: DW_TAG_member, name: "fully_specified", scope: !13, file: !3, line: 3, baseType: !9, flags: DIFlagStaticMember) |
| 73 |
!16 = !DICompositeType(tag: DW_TAG_array_type, baseType: !9, elements: !17) |
| 74 |
!17 = !{!18} |
| 75 |
!18 = !DISubrange(count: -1) |
| 76 |
!19 = !{i32 2, !"Dwarf Version", i32 4} |
| 77 |
!20 = !{i32 2, !"Debug Info Version", i32 3} |
| 78 |
!21 = !{i32 1, !"PIC Level", i32 2} |
| 79 |
!22 = !{!"clang version 4.0.0 (trunk 286129) (llvm/trunk 286128)"} |
| 80 |
|