brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.2 KiB · 4aed260 Raw
88 lines · plain
1// RUN: mlir-opt -test-spirv-module-combiner -split-input-file -verify-diagnostics %s | FileCheck %s2 3// Combine modules without the same symbols4 5// CHECK:      module {6// CHECK-NEXT:   spirv.module Logical GLSL450 {7// CHECK-NEXT:     spirv.SpecConstant @m1_sc8// CHECK-NEXT:     spirv.GlobalVariable @m1_gv bind(1, 0)9// CHECK-NEXT:     spirv.func @no_op10// CHECK-NEXT:       spirv.Return11// CHECK-NEXT:     }12// CHECK-NEXT:     spirv.EntryPoint "GLCompute" @no_op13// CHECK-NEXT:     spirv.ExecutionMode @no_op "LocalSize", 32, 1, 114 15// CHECK-NEXT:     spirv.SpecConstant @m2_sc16// CHECK-NEXT:     spirv.GlobalVariable @m2_gv bind(0, 1)17// CHECK-NEXT:     spirv.func @variable_init_spec_constant18// CHECK-NEXT:       spirv.mlir.referenceof @m2_sc19// CHECK-NEXT:       spirv.Variable init20// CHECK-NEXT:       spirv.Return21// CHECK-NEXT:     }22// CHECK-NEXT:   }23// CHECK-NEXT: }24 25module {26spirv.module Logical GLSL450 {27  spirv.SpecConstant @m1_sc = 42.42 : f3228  spirv.GlobalVariable @m1_gv bind(1, 0): !spirv.ptr<f32, Input>29  spirv.func @no_op() -> () "None" {30    spirv.Return31  }32  spirv.EntryPoint "GLCompute" @no_op33  spirv.ExecutionMode @no_op "LocalSize", 32, 1, 134}35 36spirv.module Logical GLSL450 {37  spirv.SpecConstant @m2_sc = 42 : i3238  spirv.GlobalVariable @m2_gv bind(0, 1): !spirv.ptr<f32, Input>39  spirv.func @variable_init_spec_constant() -> () "None" {40    %0 = spirv.mlir.referenceof @m2_sc : i3241    %1 = spirv.Variable init(%0) : !spirv.ptr<i32, Function>42    spirv.Return43  }44}45}46 47// -----48 49module {50spirv.module Physical64 GLSL450 {51}52 53// expected-error @+1 {{input modules differ in addressing model, memory model, and/or VCE triple}}54spirv.module Logical GLSL450 {55}56}57 58// -----59 60module {61spirv.module Logical Simple {62}63 64// expected-error @+1 {{input modules differ in addressing model, memory model, and/or VCE triple}}65spirv.module Logical GLSL450 {66}67}68 69// -----70 71module {72spirv.module Logical GLSL450 {73}74 75// expected-error @+1 {{input modules differ in addressing model, memory model, and/or VCE triple}}76spirv.module Logical GLSL450 requires #spirv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]> {77}78}79 80// -----81 82// No spir-v modules to combine.83module {84  func.func @foo(%arg0: i32) -> i32 {85    return %arg0 : i3286  }87}88