11// RUN: mlir-translate -no-implicit-module -test-spirv-roundtrip -split-input-file %s | FileCheck %s
22
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+
38// CHECK: spirv.GlobalVariable @var0 bind(1, 0) : !spirv.ptr<f32, Input>
49// CHECK-NEXT: spirv.GlobalVariable @var1 bind(0, 1) : !spirv.ptr<f32, Output>
510// CHECK-NEXT: spirv.GlobalVariable @var2 built_in("GlobalInvocationId") : !spirv.ptr<vector<3xi32>, Input>
611// CHECK-NEXT: spirv.GlobalVariable @var3 built_in("GlobalInvocationId") : !spirv.ptr<vector<3xi32>, Input>
712
8- spirv.module Logical GLSL450 requires #spirv.vce <v1.0 , [Shader ], []> {
13+ spirv.module Logical GLSL450 requires #spirv.vce <v1.0 , [Shader , Linkage ], []> {
914 spirv.GlobalVariable @var0 bind (1 , 0 ) : !spirv.ptr <f32 , Input >
1015 spirv.GlobalVariable @var1 bind (0 , 1 ) : !spirv.ptr <f32 , Output >
1116 spirv.GlobalVariable @var2 {built_in = " GlobalInvocationId" } : !spirv.ptr <vector <3 xi32 >, Input >
@@ -14,16 +19,7 @@ spirv.module Logical GLSL450 requires #spirv.vce<v1.0, [Shader], []> {
1419
1520// -----
1621
17- spirv.module Logical GLSL450 requires #spirv.vce <v1.0 , [Shader ], []> {
18- // CHECK: spirv.GlobalVariable @var1 : !spirv.ptr<f32, Input>
19- // CHECK-NEXT: spirv.GlobalVariable @var2 initializer(@var1) bind(1, 0) : !spirv.ptr<f32, Input>
20- spirv.GlobalVariable @var1 : !spirv.ptr <f32 , Input >
21- spirv.GlobalVariable @var2 initializer (@var1 ) bind (1 , 0 ) : !spirv.ptr <f32 , Input >
22- }
23-
24- // -----
25-
26- spirv.module Logical GLSL450 requires #spirv.vce <v1.0 , [Shader ], []> {
22+ spirv.module Logical GLSL450 requires #spirv.vce <v1.0 , [Shader , Linkage , Int8 ], []> {
2723 // CHECK: spirv.SpecConstant @sc = 1 : i8
2824 // CHECK-NEXT: spirv.GlobalVariable @var initializer(@sc) : !spirv.ptr<i8, Uniform>
2925 spirv.SpecConstant @sc = 1 : i8
@@ -33,7 +29,7 @@ spirv.module Logical GLSL450 requires #spirv.vce<v1.0, [Shader], []> {
3329
3430// -----
3531
36- spirv.module Logical GLSL450 requires #spirv.vce <v1.0 , [Shader ], []> {
32+ spirv.module Logical GLSL450 requires #spirv.vce <v1.0 , [Shader , Linkage , Int8 ], []> {
3733 // CHECK: spirv.SpecConstantComposite @scc (@sc0, @sc1, @sc2) : !spirv.array<3 x i8>
3834 // CHECK-NEXT: spirv.GlobalVariable @var initializer(@scc) : !spirv.ptr<!spirv.array<3 x i8>, Uniform>
3935 spirv.SpecConstant @sc0 = 1 : i8
@@ -47,7 +43,7 @@ spirv.module Logical GLSL450 requires #spirv.vce<v1.0, [Shader], []> {
4743
4844// -----
4945
50- spirv.module Logical GLSL450 requires #spirv.vce <v1.0 , [Shader ], []> {
46+ spirv.module Logical GLSL450 requires #spirv.vce <v1.0 , [Shader , Linkage ], []> {
5147 spirv.GlobalVariable @globalInvocationID built_in (" GlobalInvocationId" ) : !spirv.ptr <vector <3 xi32 >, Input >
5248 spirv.func @foo () " None" {
5349 // CHECK: %[[ADDR:.*]] = spirv.mlir.addressof @globalInvocationID : !spirv.ptr<vector<3xi32>, Input>
0 commit comments