| 1 |
; Test checks that DW_LANG_C99, DW_LANG_OpenCL, and all DW_LANG_C_plus_plus_X are mapped to |
| 2 |
; appropriate SourceLanguages in SPIRV when the extended debug info is enabled. |
| 3 |
|
| 4 |
; RUN: sed -e 's/INPUT_LANGUAGE/DW_LANG_C99/' %s | llvm-as - -o %t.bc |
| 5 |
; RUN: llvm-spirv --spirv-debug-info-version=nonsemantic-shader-200 -spirv-text %t.bc -o - | FileCheck %s --check-prefix=CHECK-C99 |
| 6 |
|
| 7 |
; RUN: sed -e 's/INPUT_LANGUAGE/DW_LANG_OpenCL/' %s | llvm-as - -o %t.bc |
| 8 |
; RUN: llvm-spirv --spirv-debug-info-version=nonsemantic-shader-200 -spirv-text %t.bc -o - | FileCheck %s --check-prefix=CHECK-OPENCLC |
| 9 |
|
| 10 |
; RUN: sed -e 's/INPUT_LANGUAGE/DW_LANG_C_plus_plus/' %s | llvm-as - -o %t.bc |
| 11 |
; RUN: llvm-spirv --spirv-debug-info-version=nonsemantic-shader-200 -spirv-text %t.bc -o - | FileCheck %s --check-prefix=CHECK-CPP |
| 12 |
|
| 13 |
; RUN: sed -e 's/INPUT_LANGUAGE/DW_LANG_C_plus_plus_14/' %s | llvm-as - -o %t.bc |
| 14 |
; RUN: llvm-spirv --spirv-debug-info-version=nonsemantic-shader-200 -spirv-text %t.bc -o - | FileCheck %s --check-prefix=CHECK-CPP14 |
| 15 |
|
| 16 |
; CHECK-C99: Constant [[#]] [[#Constant:]] 211 |
| 17 |
; CHECK-C99: DebugCompilationUnit [[#]] [[#]] [[#]] [[#Constant]] |
| 18 |
; CHECK-OPENCLC: Constant [[#]] [[#Constant:]] 3 |
| 19 |
; CHECK-OPENCLC: DebugCompilationUnit [[#]] [[#]] [[#]] [[#Constant]] |
| 20 |
; CHECK-CPP: Constant [[#]] [[#Constant:]] 214 |
| 21 |
; CHECK-CPP: DebugCompilationUnit [[#]] [[#]] [[#]] [[#Constant]] |
| 22 |
; CHECK-CPP14: Constant [[#]] [[#Constant:]] 217 |
| 23 |
; CHECK-CPP14: DebugCompilationUnit [[#]] [[#]] [[#]] [[#Constant]] |
| 24 |
|
| 25 |
target datalayout = "e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024" |
| 26 |
target triple = "spir64-unknown-unknown" |
| 27 |
|
| 28 |
define dso_local spir_kernel void @func() local_unnamed_addr !dbg !7 !kernel_arg_addr_space !2 !kernel_arg_access_qual !2 !kernel_arg_type !2 !kernel_arg_base_type !2 !kernel_arg_type_qual !2 { |
| 29 |
entry: |
| 30 |
ret void |
| 31 |
} |
| 32 |
|
| 33 |
!llvm.dbg.cu = !{!0} |
| 34 |
!llvm.module.flags = !{!3, !4, !5} |
| 35 |
|
| 36 |
!0 = distinct !DICompileUnit(language: INPUT_LANGUAGE, file: !1) |
| 37 |
!1 = !DIFile(filename: "test.cl", directory: "/tmp", checksumkind: CSK_MD5, checksum: "18aa9ce738eaafc7b7b7181c19092815") |
| 38 |
!2 = !{} |
| 39 |
!3 = !{i32 7, !"Dwarf Version", i32 5} |
| 40 |
!4 = !{i32 2, !"Debug Info Version", i32 3} |
| 41 |
!5 = !{i32 1, !"wchar_size", i32 4} |
| 42 |
!6 = !{i32 2, i32 0} |
| 43 |
!7 = distinct !DISubprogram(name: "func", scope: !8, file: !8, line: 1, scopeLine: 2, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !2) |
| 44 |
!8 = !DIFile(filename: "test.cl", directory: "/tmp", checksumkind: CSK_MD5, checksum: "18aa9ce738eaafc7b7b7181c19092815") |