llvm-project/llvm/test/CodeGen/SPIRV/align-duplicate.ll
Ebin-McW 3a1cb68fb6
[SPIRV] Porting 4 tests from Translator (#151678)
Tests that checks:
 - Duplicate alignment
 - Duplicate types
 - Non-function storage class for global variable
 - Generating image instructions from opencl builtins

---------

Co-authored-by: Michal Paszkowski <michal@michalpaszkowski.com>
2025-08-03 22:27:36 +02:00

17 lines
530 B
LLVM

; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv64-unknown-unknown %s -o - | FileCheck %s
; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv64-unknown-unknown %s -o - -filetype=obj | spirv-val %}
; Test that duplicate align information does not result in SPIR-V validation
; errors due to duplicate Alignment Decorations.
;CHECK: OpDecorate %[[#Var:]] Alignment
;CHECK: %[[#Var]] = OpVariable %[[#]]
define spir_func void @f() {
%res = alloca i16, align 2, !spirv.Decorations !1
ret void
}
!1 = !{!2}
!2 = !{i32 44, i32 2}