| 1 |
; Test checks that: |
| 2 |
; - OpenCL_CPP is mapped to DW_LANG_C_plus_plus_14 |
| 3 |
; - CPP_for_OpenCL is mapped to DW_LANG_C_plus_plus_17 |
| 4 |
; - OpenCL_C, GLSL, ESSL, HLSL, and Unknown are mapped to DW_LANG_OpenCL |
| 5 |
|
| 6 |
; LLVM does not yet define DW_LANG_C_plus_plus_17. When it is defined, the |
| 7 |
; test case for C++ for OpenCL should be updated to check that CPP_for_OpenCL |
| 8 |
; is mapped to DW_LANG_C_plus_plus_17, not DW_LANG_C_plus_plus_14. |
| 9 |
|
| 10 |
; REQUIRES: spirv-as |
| 11 |
|
| 12 |
; RUN: sed -e 's/SOURCE_LANGUAGE/OpenCL_CPP/' %s | spirv-as --target-env spv1.3 - -o %t.spv |
| 13 |
; RUN: llvm-spirv -r -emit-opaque-pointers %t.spv -o - | llvm-dis | FileCheck %s --check-prefix=CHECK-CPP14 |
| 14 |
|
| 15 |
; COM: TODO: Enable this test when the version of SPIRV-Tools used by buildbot is updated to |
| 16 |
; COM: recognise CPP_for_OpenCL as a valid source language. |
| 17 |
; COM: sed -e 's/SOURCE_LANGUAGE/CPP_for_OpenCL/' %s | spirv-as --target-env spv1.3 - -o %t.spv |
| 18 |
; COM: llvm-spirv -r %t.spv -o - | llvm-dis | FileCheck %s --check-prefix=CHECK-CPP14 |
| 19 |
|
| 20 |
; RUN: sed -e 's/SOURCE_LANGUAGE/OpenCL_C/' %s | spirv-as --target-env spv1.3 - -o %t.spv |
| 21 |
; RUN: llvm-spirv -r -emit-opaque-pointers %t.spv -o - | llvm-dis | FileCheck %s --check-prefix=CHECK-OPENCL |
| 22 |
|
| 23 |
; RUN: sed -e 's/SOURCE_LANGUAGE/GLSL/' %s | spirv-as --target-env spv1.3 - -o %t.spv |
| 24 |
; RUN: llvm-spirv -r -emit-opaque-pointers %t.spv -o - | llvm-dis | FileCheck %s --check-prefix=CHECK-OPENCL |
| 25 |
|
| 26 |
; RUN: sed -e 's/SOURCE_LANGUAGE/HLSL/' %s | spirv-as --target-env spv1.3 - -o %t.spv |
| 27 |
; RUN: llvm-spirv -r -emit-opaque-pointers %t.spv -o - | llvm-dis | FileCheck %s --check-prefix=CHECK-OPENCL |
| 28 |
|
| 29 |
; RUN: sed -e 's/SOURCE_LANGUAGE/ESSL/' %s | spirv-as --target-env spv1.3 - -o %t.spv |
| 30 |
; RUN: llvm-spirv -r -emit-opaque-pointers %t.spv -o - | llvm-dis | FileCheck %s --check-prefix=CHECK-OPENCL |
| 31 |
|
| 32 |
; RUN: sed -e 's/SOURCE_LANGUAGE/Unknown/' %s | spirv-as --target-env spv1.3 - -o %t.spv |
| 33 |
; RUN: llvm-spirv -r -emit-opaque-pointers %t.spv -o - | llvm-dis | FileCheck %s --check-prefix=CHECK-OPENCL |
| 34 |
|
| 35 |
; SPIR-V |
| 36 |
; Version: 1.1 |
| 37 |
; Generator: Khronos LLVM/SPIR-V Translator; 14 |
| 38 |
; Bound: 16 |
| 39 |
; Schema: 0 |
| 40 |
OpCapability Addresses |
| 41 |
OpCapability Kernel |
| 42 |
%1 = OpExtInstImport "OpenCL.std" |
| 43 |
%2 = OpExtInstImport "OpenCL.DebugInfo.100" |
| 44 |
OpMemoryModel Physical64 OpenCL |
| 45 |
OpEntryPoint Kernel %5 "func" |
| 46 |
%7 = OpString "kernel_arg_type.func." |
| 47 |
%8 = OpString "/tmp/test.cl" |
| 48 |
%9 = OpString "//__CSK_MD5:18aa9ce738eaafc7b7b7181c19092815" |
| 49 |
%12 = OpString "func" |
| 50 |
%14 = OpString "" |
| 51 |
OpSource Unknown 0 |
| 52 |
OpName %entry "entry" |
| 53 |
OpModuleProcessed "Debug info producer: " |
| 54 |
%void = OpTypeVoid |
| 55 |
%4 = OpTypeFunction %void |
| 56 |
%10 = OpExtInst %void %2 DebugSource %8 %9 |
| 57 |
%11 = OpExtInst %void %2 DebugCompilationUnit 65536 5 %10 SOURCE_LANGUAGE |
| 58 |
%13 = OpExtInst %void %2 DebugInfoNone |
| 59 |
%15 = OpExtInst %void %2 DebugFunction %12 %13 %10 1 0 %11 %14 FlagIsDefinition|FlagPrototyped|FlagIsOptimized 2 %5 %13 |
| 60 |
%5 = OpFunction %void None %4 |
| 61 |
%entry = OpLabel |
| 62 |
OpReturn |
| 63 |
OpFunctionEnd |
| 64 |
|
| 65 |
; CHECK-OPENCL: !DICompileUnit(language: DW_LANG_OpenCL, |
| 66 |
; CHECK-CPP14: !DICompileUnit(language: DW_LANG_C_plus_plus_14, |