| 1 |
; Test that an image type name suffixed with .<n> does not crash the |
| 2 |
; translator. |
| 3 |
|
| 4 |
; RUN: llvm-as %s -o %t.bc |
| 5 |
; RUN: llvm-spirv %t.bc -o %t.spv |
| 6 |
; RUN: spirv-val %t.spv |
| 7 |
; RUN: llvm-spirv -r -emit-opaque-pointers %t.spv -o %t.rev.bc |
| 8 |
; RUN: llvm-dis < %t.rev.bc | FileCheck %s --check-prefix=CHECK-LLVM |
| 9 |
|
| 10 |
; CHECK-LLVM: call spir_func i32 @_Z15get_image_width14ocl_image1d_ro( |
| 11 |
|
| 12 |
; ModuleID = 'foo.ll' |
| 13 |
target datalayout = "e-p:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024" |
| 14 |
target triple = "spir-unknown-unknown" |
| 15 |
|
| 16 |
%opencl.image1d_ro_t.2 = type opaque |
| 17 |
|
| 18 |
; Function Attrs: convergent nounwind writeonly |
| 19 |
define spir_kernel void @foo(%opencl.image1d_ro_t.2 addrspace(1)* %im, i32 addrspace(1)* nocapture %res) local_unnamed_addr #0 !kernel_arg_addr_space !4 !kernel_arg_access_qual !5 !kernel_arg_type !6 !kernel_arg_base_type !6 !kernel_arg_type_qual !7 { |
| 20 |
entry: |
| 21 |
%call = tail call spir_func i32 @_Z15get_image_width14ocl_image1d_ro(%opencl.image1d_ro_t.2 addrspace(1)* %im) #2 |
| 22 |
store i32 %call, i32 addrspace(1)* %res, align 4, !tbaa !8 |
| 23 |
ret void |
| 24 |
} |
| 25 |
|
| 26 |
; Function Attrs: convergent nounwind readnone |
| 27 |
declare spir_func i32 @_Z15get_image_width14ocl_image1d_ro(%opencl.image1d_ro_t.2 addrspace(1)*) local_unnamed_addr #1 |
| 28 |
|
| 29 |
attributes #0 = { convergent nounwind writeonly "correctly-rounded-divide-sqrt-fp-math"="false" "denorms-are-zero"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "uniform-work-group-size"="true" "unsafe-fp-math"="false" "use-soft-float"="false" } |
| 30 |
attributes #1 = { convergent nounwind readnone "correctly-rounded-divide-sqrt-fp-math"="false" "denorms-are-zero"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" } |
| 31 |
attributes #2 = { convergent nounwind readnone } |
| 32 |
|
| 33 |
!llvm.module.flags = !{!0} |
| 34 |
!opencl.ocl.version = !{!1} |
| 35 |
!opencl.spir.version = !{!2} |
| 36 |
!llvm.ident = !{!3} |
| 37 |
|
| 38 |
!0 = !{i32 1, !"wchar_size", i32 4} |
| 39 |
!1 = !{i32 1, i32 0} |
| 40 |
!2 = !{i32 1, i32 2} |
| 41 |
!3 = !{!"clang version 8.0.0"} |
| 42 |
!4 = !{i32 1, i32 1} |
| 43 |
!5 = !{!"read_only", !"none"} |
| 44 |
!6 = !{!"image1d_t", !"int*"} |
| 45 |
!7 = !{!"", !""} |
| 46 |
!8 = !{!9, !9, i64 0} |
| 47 |
!9 = !{!"int", !10, i64 0} |
| 48 |
!10 = !{!"omnipotent char", !11, i64 0} |
| 49 |
!11 = !{!"Simple C/C++ TBAA"} |