| 1 |
; Adapted from https://github.com/KhronosGroup/SPIRV-LLVM-Translator/tree/main/test/extensions/INTEL/SPV_INTEL_global_variable_host_access |
| 2 |
|
| 3 |
; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv64-unknown-unknown --spirv-ext=+SPV_INTEL_global_variable_host_access,+SPV_INTEL_global_variable_fpga_decorations %s -o - | FileCheck %s --check-prefixes=CHECK-SPIRV |
| 4 |
; TODO: %if spirv-tools %{ llc -O0 -mtriple=spirv64-unknown-unknown --spirv-ext=+SPV_INTEL_global_variable_host_access,+SPV_INTEL_global_variable_fpga_decorations %s -o - -filetype=obj | spirv-val %} |
| 5 |
|
| 6 |
; CHECK-SPIRV-DAG: Capability GlobalVariableHostAccessINTEL |
| 7 |
; CHECK-SPIRV-DAG: Capability GlobalVariableFPGADecorationsINTEL |
| 8 |
; CHECK-SPIRV-DAG: Extension "SPV_INTEL_global_variable_host_access" |
| 9 |
; CHECK-SPIRV-DAG: Extension "SPV_INTEL_global_variable_fpga_decorations" |
| 10 |
|
| 11 |
; CHECK-SPIRV-DAG: OpName %[[#G1:]] "int_var" |
| 12 |
; CHECK-SPIRV-DAG: OpName %[[#G2:]] "bool_var" |
| 13 |
; CHECK-SPIRV-DAG: OpName %[[#G3:]] "float_var" |
| 14 |
; CHECK-SPIRV-DAG: OpDecorate %[[#G1]] HostAccessINTEL 1 "IntVarName" |
| 15 |
; CHECK-SPIRV-DAG: OpDecorate %[[#G2]] HostAccessINTEL 3 "BoolVarName" |
| 16 |
; CHECK-SPIRV-DAG: OpDecorate %[[#G3]] ImplementInRegisterMapINTEL 1 |
| 17 |
; CHECK-SPIRV-DAG: OpDecorate %[[#G3]] InitModeINTEL 1 |
| 18 |
|
| 19 |
@int_var = addrspace(1) global i32 42, !spirv.Decorations !1 |
| 20 |
@bool_var = addrspace(1) global i1 0, !spirv.Decorations !4 |
| 21 |
@float_var = addrspace(1) global float 1.0, !spirv.Decorations !5 |
| 22 |
|
| 23 |
define spir_kernel void @test() { |
| 24 |
entry: |
| 25 |
ret void |
| 26 |
} |
| 27 |
|
| 28 |
!1 = !{!2} |
| 29 |
!2 = !{i32 6188, i32 1, !"IntVarName"} ; HostAccessINTEL 1 "IntVarName" |
| 30 |
!3 = !{i32 6188, i32 3, !"BoolVarName"} ; HostAccessINTEL 3 "BoolVarName" |
| 31 |
!4 = !{!3} |
| 32 |
!5 = !{!6, !7} |
| 33 |
!6 = !{i32 6191, i1 true} ; ImplementInRegisterMapINTEL = true |
| 34 |
!7 = !{i32 6190, i32 1} ; InitModeINTEL = 1 |