brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.7 KiB · 08ac1ff Raw
39 lines · plain
1// RUN: mlir-translate -no-implicit-module -split-input-file -test-spirv-roundtrip %s | FileCheck %s2 3// RUN: %if spirv-tools %{ rm -rf %t %}4// RUN: %if spirv-tools %{ mkdir %t %}5// RUN: %if spirv-tools %{ mlir-translate --no-implicit-module --serialize-spirv --split-input-file --spirv-save-validation-files-with-prefix=%t/module %s %}6// RUN: %if spirv-tools %{ spirv-val %t %}7 8spirv.module Logical GLSL450 requires #spirv.vce<v1.0, [Shader, Linkage], [SPV_KHR_storage_buffer_storage_class]> {9  spirv.func @foo() -> () "None" {10    // CHECK: {{%.*}} = spirv.Undef : f3211    // CHECK-NEXT: {{%.*}} = spirv.Undef : f3212    %0 = spirv.Undef : f3213    %1 = spirv.Undef : f3214    %2 = spirv.FAdd %0, %1 : f3215    // CHECK: {{%.*}} = spirv.Undef : vector<4xi32>16    %3 = spirv.Undef : vector<4xi32>17    %4 = spirv.CompositeExtract %3[1 : i32] : vector<4xi32>18    // CHECK: {{%.*}} = spirv.Undef : !spirv.array<4 x !spirv.array<4 x i32>>19    %5 = spirv.Undef : !spirv.array<4x!spirv.array<4xi32>>20    %6 = spirv.CompositeExtract %5[1 : i32, 2 : i32] : !spirv.array<4x!spirv.array<4xi32>>21    // CHECK: {{%.*}} = spirv.Undef : !spirv.ptr<!spirv.struct<(f32), Block>, StorageBuffer>22    %7 = spirv.Undef : !spirv.ptr<!spirv.struct<(f32), Block>, StorageBuffer>23    %8 = spirv.Constant 0 : i3224    %9 = spirv.AccessChain %7[%8] : !spirv.ptr<!spirv.struct<(f32), Block>, StorageBuffer>, i32 -> !spirv.ptr<f32, StorageBuffer>25    spirv.Return26  }27}28 29// -----30 31spirv.module Logical GLSL450 requires #spirv.vce<v1.0, [Shader, Linkage], []> {32  // CHECK: spirv.func {{@.*}}33  spirv.func @ignore_unused_undef() -> () "None" {34    // CHECK-NEXT: spirv.Return35    %0 = spirv.Undef : f3236    spirv.Return37  }38}39