| 1 |
; ModuleID = '/Volumes/Data/apple-internal/llvm/tools/clang/test/Modules/debug-info-moduleimport.m' |
| 2 |
; RUN: llvm-as < %s -o %t.bc |
| 3 |
; RUN: llvm-spirv --spirv-debug-info-version=nonsemantic-shader-200 %t.bc -o %t.spv |
| 4 |
; RUN: llvm-spirv -r -emit-opaque-pointers %t.spv -o - | llvm-dis -o %t.ll |
| 5 |
|
| 6 |
; RUN: llc -mtriple=x86_64-apple-macosx %t.ll -accel-tables=Dwarf -o %t -filetype=obj |
| 7 |
; RUN: llvm-dwarfdump -debug-info %t | FileCheck %s |
| 8 |
; RUN: llvm-dwarfdump -verify %t |
| 9 |
|
| 10 |
; RUN: llvm-spirv --spirv-debug-info-version=nonsemantic-shader-200 %t.bc -spirv-text -o %t.spt |
| 11 |
; RUN: FileCheck %s --input-file %t.spt --check-prefix CHECK-SPIRV |
| 12 |
|
| 13 |
; CHECK: DW_TAG_compile_unit |
| 14 |
; CHECK-NOT: DW_TAG |
| 15 |
; CHECK: DW_TAG_module |
| 16 |
; CHECK-NEXT: DW_AT_name {{.*}}"DebugModule" |
| 17 |
; CHECK-NEXT: DW_AT_LLVM_config_macros {{.*}}"-DMODULES=0" |
| 18 |
; CHECK-NEXT: DW_AT_LLVM_include_path {{.*}}"/llvm/tools/clang/test/Modules/Inputs" |
| 19 |
; CHECK-NEXT: DW_AT_LLVM_apinotes {{.*}}"m.apinotes" |
| 20 |
|
| 21 |
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" |
| 22 |
target triple = "spir64-unknown-unknown" |
| 23 |
|
| 24 |
; CHECK-SPIRV-DAG: ExtInstImport [[#EISId:]] "NonSemantic.Shader.DebugInfo.200" |
| 25 |
; CHECK-SPIRV: String [[#FileName:]] "/llvm/tools/clang/test/Modules/<stdin>" |
| 26 |
; CHECK-SPIRV: String [[#EmptyStr:]] "" |
| 27 |
; CHECK-SPIRV: String [[#Name:]] "DebugModule" |
| 28 |
; CHECK-SPIRV: String [[#Defines:]] "-DMODULES=0" |
| 29 |
; CHECK-SPIRV: String [[#IncludePath:]] "/llvm/tools/clang/test/Modules/Inputs" |
| 30 |
; CHECK-SPIRV: String [[#ApiNotes:]] "m.apinotes" |
| 31 |
; CHECK-SPIRV: TypeInt [[#TypeInt32:]] 32 0 |
| 32 |
; CHECK-SPIRV-DAG: Constant [[#TypeInt32]] [[#Constant0:]] 0 |
| 33 |
; CHECK-SPIRV-DAG: Constant [[#TypeInt32]] [[#Version:]] 65536 |
| 34 |
; CHECK-SPIRV-DAG: Constant [[#TypeInt32]] [[#DWARF:]] 4 |
| 35 |
|
| 36 |
; CHECK-SPIRV: ExtInst [[#]] [[#Source:]] [[#]] DebugSource [[#FileName]] |
| 37 |
; CHECK-SPIRV: ExtInst [[#]] [[#Parent:]] [[#]] DebugCompilationUnit [[#Version]] [[#DWARF]] |
| 38 |
; CHECK-SPIRV: ExtInst [[#]] [[#SourceEmpty:]] [[#]] DebugSource [[#EmptyStr]] |
| 39 |
; CHECK-SPIRV: ExtInst [[#]] [[#Module:]] [[#]] DebugModule [[#Name]] [[#SourceEmpty]] [[#Constant0]] [[#Parent]] [[#Defines]] [[#IncludePath]] [[#ApiNotes]] [[#Constant0]] |
| 40 |
; CHECK-SPIRV: ExtInst [[#]] [[#]] [[#]] DebugImportedEntity [[#]] [[#]] [[#Source]] [[#Module]] |
| 41 |
|
| 42 |
!llvm.dbg.cu = !{!0} |
| 43 |
!llvm.module.flags = !{!6, !7} |
| 44 |
!llvm.ident = !{!8} |
| 45 |
|
| 46 |
!0 = distinct !DICompileUnit(language: DW_LANG_ObjC, file: !1, producer: "LLVM version 3.7.0", isOptimized: false, runtimeVersion: 2, emissionKind: FullDebug, enums: !2, retainedTypes: !2, globals: !2, imports: !3, sysroot: "/") |
| 47 |
!1 = !DIFile(filename: "/llvm/tools/clang/test/Modules/<stdin>", directory: "/") |
| 48 |
!2 = !{} |
| 49 |
!3 = !{!4} |
| 50 |
!4 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !0, entity: !5, file: !1, line: 5) |
| 51 |
!5 = !DIModule(scope: null, name: "DebugModule", configMacros: "-DMODULES=0", includePath: "/llvm/tools/clang/test/Modules/Inputs", apinotes: "m.apinotes") |
| 52 |
!6 = !{i32 2, !"Dwarf Version", i32 4} |
| 53 |
!7 = !{i32 2, !"Debug Info Version", i32 3} |
| 54 |
!8 = !{!"LLVM version 3.7.0"} |