|
| 1 | +; This test checks that the decoding of DebugTypeTemplateParameterPack and |
| 2 | +; DebugTypeTemplateTemplateParameter is correct. |
| 3 | + |
| 4 | +; REQUIRES: spirv-as |
| 5 | + |
| 6 | +; RUN: spirv-as --target-env spv1.3 %s -o %t.spv |
| 7 | +; RUN: llvm-spirv -r %t.spv -o - | llvm-dis | FileCheck %s |
| 8 | + |
| 9 | +; SPIR-V |
| 10 | +; Version: 1.1 |
| 11 | +; Generator: Khronos LLVM/SPIR-V Translator; 14 |
| 12 | +; Bound: 16 |
| 13 | +; Schema: 0 |
| 14 | + OpCapability Addresses |
| 15 | + OpCapability Kernel |
| 16 | + %1 = OpExtInstImport "OpenCL.std" |
| 17 | + %2 = OpExtInstImport "OpenCL.DebugInfo.100" |
| 18 | + OpMemoryModel Physical64 OpenCL |
| 19 | + OpEntryPoint Kernel %5 "func" |
| 20 | + %8 = OpString "/tmp/test.cpp" |
| 21 | + %9 = OpString "//__CSK_MD5:18aa9ce738eaafc7b7b7181c19092815" |
| 22 | + %12 = OpString "func" |
| 23 | + %14 = OpString "" |
| 24 | + %15 = OpString "T" |
| 25 | + %16 = OpString "U" |
| 26 | + %17 = OpString "Foo" |
| 27 | + OpSource OpenCL_CPP 100000 |
| 28 | + OpName %entry "entry" |
| 29 | + %void = OpTypeVoid |
| 30 | + %4 = OpTypeFunction %void |
| 31 | + %10 = OpExtInst %void %2 DebugSource %8 %9 |
| 32 | + %11 = OpExtInst %void %2 DebugCompilationUnit 65536 5 %10 OpenCL_CPP |
| 33 | + %13 = OpExtInst %void %2 DebugInfoNone |
| 34 | + %20 = OpExtInst %void %2 DebugFunction %12 %13 %10 1 0 %11 %14 FlagIsDefinition|FlagPrototyped|FlagIsOptimized 2 %5 %13 |
| 35 | + %18 = OpExtInst %void %2 DebugTypeTemplateParameterPack %15 %10 0 0 %13 %13 |
| 36 | + %19 = OpExtInst %void %2 DebugTypeTemplateTemplateParameter %16 %17 %10 0 0 |
| 37 | + %21 = OpExtInst %void %2 DebugTypeTemplate %20 %18 %19 |
| 38 | + %5 = OpFunction %void None %4 |
| 39 | + %entry = OpLabel |
| 40 | + OpReturn |
| 41 | + OpFunctionEnd |
| 42 | + |
| 43 | +; CHECK: = distinct !DISubprogram(name: "func", |
| 44 | +; CHECK-SAME: templateParams: [[TPARAMS:![0-9]+]]{{[,)]}} |
| 45 | + |
| 46 | +; CHECK-DAG: [[TPARAMS]] = !{[[PACKPARAM:![0-9]+]], [[TTPARAM:![0-9]+]]} |
| 47 | +; CHECK-DAG: [[PACKPARAM]] = !DITemplateValueParameter(tag: DW_TAG_GNU_template_parameter_pack, name: "T", value: [[PACK:![0-9]+]]) |
| 48 | +; CHECK-DAG: [[PACK]] = !{null, null} |
| 49 | +; CHECK-DAG: [[TTPARAM]] = !DITemplateValueParameter(tag: DW_TAG_GNU_template_template_param, name: "U", value: !"Foo") |
0 commit comments