Przeglądaj źródła

Updated spirv-tools.

Бранимир Караџић 7 lat temu
rodzic
commit
926ce6a7b4
82 zmienionych plików z 3663 dodań i 1751 usunięć
  1. 2 0
      3rdparty/spirv-tools/BUILD.gn
  2. 1 1
      3rdparty/spirv-tools/include/generated/build-version.inc
  3. 16 0
      3rdparty/spirv-tools/source/opt/block_merge_util.cpp
  4. 1 2
      3rdparty/spirv-tools/source/opt/optimizer.cpp
  5. 4 0
      3rdparty/spirv-tools/source/reduce/CMakeLists.txt
  6. 67 0
      3rdparty/spirv-tools/source/reduce/merge_blocks_reduction_opportunity.cpp
  7. 53 0
      3rdparty/spirv-tools/source/reduce/merge_blocks_reduction_opportunity.h
  8. 48 0
      3rdparty/spirv-tools/source/reduce/merge_blocks_reduction_opportunity_finder.cpp
  9. 42 0
      3rdparty/spirv-tools/source/reduce/merge_blocks_reduction_opportunity_finder.h
  10. 180 1
      3rdparty/spirv-tools/source/val/validate_annotation.cpp
  11. 172 44
      3rdparty/spirv-tools/source/val/validate_builtins.cpp
  12. 54 0
      3rdparty/spirv-tools/source/val/validate_decorations.cpp
  13. 10 0
      3rdparty/spirv-tools/source/val/validate_type.cpp
  14. 74 0
      3rdparty/spirv-tools/source/val/validation_state.h
  15. 2 2
      3rdparty/spirv-tools/test/assembly_context_test.cpp
  16. 6 6
      3rdparty/spirv-tools/test/binary_parse_test.cpp
  17. 4 4
      3rdparty/spirv-tools/test/binary_to_text.literal_test.cpp
  18. 47 47
      3rdparty/spirv-tools/test/binary_to_text_test.cpp
  19. 6 6
      3rdparty/spirv-tools/test/comp/markv_codec_test.cpp
  20. 18 18
      3rdparty/spirv-tools/test/enum_set_test.cpp
  21. 8 8
      3rdparty/spirv-tools/test/enum_string_mapping_test.cpp
  22. 225 223
      3rdparty/spirv-tools/test/ext_inst.debuginfo_test.cpp
  23. 2 2
      3rdparty/spirv-tools/test/ext_inst.glsl_test.cpp
  24. 18 18
      3rdparty/spirv-tools/test/ext_inst.opencl_test.cpp
  25. 4 4
      3rdparty/spirv-tools/test/generator_magic_number_test.cpp
  26. 40 40
      3rdparty/spirv-tools/test/hex_float_test.cpp
  27. 78 78
      3rdparty/spirv-tools/test/name_mapper_test.cpp
  28. 2 2
      3rdparty/spirv-tools/test/named_id_test.cpp
  29. 2 2
      3rdparty/spirv-tools/test/opcode_require_capabilities_test.cpp
  30. 2 2
      3rdparty/spirv-tools/test/opcode_table_get_test.cpp
  31. 66 66
      3rdparty/spirv-tools/test/operand_capabilities_test.cpp
  32. 8 8
      3rdparty/spirv-tools/test/operand_pattern_test.cpp
  33. 4 4
      3rdparty/spirv-tools/test/operand_test.cpp
  34. 7 7
      3rdparty/spirv-tools/test/opt/aggressive_dead_code_elim_test.cpp
  35. 139 0
      3rdparty/spirv-tools/test/opt/block_merge_test.cpp
  36. 6 6
      3rdparty/spirv-tools/test/opt/def_use_test.cpp
  37. 7 7
      3rdparty/spirv-tools/test/opt/eliminate_dead_const_test.cpp
  38. 152 152
      3rdparty/spirv-tools/test/opt/flatten_decoration_test.cpp
  39. 8 8
      3rdparty/spirv-tools/test/opt/fold_spec_const_op_composite_test.cpp
  40. 42 42
      3rdparty/spirv-tools/test/opt/fold_test.cpp
  41. 1 1
      3rdparty/spirv-tools/test/opt/freeze_spec_const_test.cpp
  42. 6 6
      3rdparty/spirv-tools/test/opt/set_spec_const_default_value_test.cpp
  43. 1 1
      3rdparty/spirv-tools/test/opt/strip_debug_info_test.cpp
  44. 8 2
      3rdparty/spirv-tools/test/opt/unify_const_test.cpp
  45. 1 1
      3rdparty/spirv-tools/test/opt/utils_test.cpp
  46. 2 1
      3rdparty/spirv-tools/test/reduce/CMakeLists.txt
  47. 513 0
      3rdparty/spirv-tools/test/reduce/merge_blocks_test.cpp
  48. 3 3
      3rdparty/spirv-tools/test/target_env_test.cpp
  49. 8 8
      3rdparty/spirv-tools/test/text_literal_test.cpp
  50. 20 20
      3rdparty/spirv-tools/test/text_to_binary.annotation_test.cpp
  51. 30 30
      3rdparty/spirv-tools/test/text_to_binary.constant_test.cpp
  52. 16 16
      3rdparty/spirv-tools/test/text_to_binary.control_flow_test.cpp
  53. 18 18
      3rdparty/spirv-tools/test/text_to_binary.debug_test.cpp
  54. 2 2
      3rdparty/spirv-tools/test/text_to_binary.device_side_enqueue_test.cpp
  55. 42 42
      3rdparty/spirv-tools/test/text_to_binary.extension_test.cpp
  56. 2 2
      3rdparty/spirv-tools/test/text_to_binary.function_test.cpp
  57. 2 2
      3rdparty/spirv-tools/test/text_to_binary.group_test.cpp
  58. 21 21
      3rdparty/spirv-tools/test/text_to_binary.image_test.cpp
  59. 4 4
      3rdparty/spirv-tools/test/text_to_binary.memory_test.cpp
  60. 10 10
      3rdparty/spirv-tools/test/text_to_binary.mode_setting_test.cpp
  61. 8 8
      3rdparty/spirv-tools/test/text_to_binary.type_declaration_test.cpp
  62. 12 12
      3rdparty/spirv-tools/test/text_to_binary_test.cpp
  63. 3 0
      3rdparty/spirv-tools/test/val/CMakeLists.txt
  64. 306 337
      3rdparty/spirv-tools/test/val/val_builtins_test.cpp
  65. 40 35
      3rdparty/spirv-tools/test/val/val_capability_test.cpp
  66. 3 3
      3rdparty/spirv-tools/test/val/val_cfg_test.cpp
  67. 222 0
      3rdparty/spirv-tools/test/val/val_code_generator.cpp
  68. 49 0
      3rdparty/spirv-tools/test/val/val_code_generator.h
  69. 5 5
      3rdparty/spirv-tools/test/val/val_constants_test.cpp
  70. 328 4
      3rdparty/spirv-tools/test/val/val_decoration_test.cpp
  71. 212 212
      3rdparty/spirv-tools/test/val/val_ext_inst_test.cpp
  72. 9 9
      3rdparty/spirv-tools/test/val/val_extensions_test.cpp
  73. 3 3
      3rdparty/spirv-tools/test/val/val_id_test.cpp
  74. 3 3
      3rdparty/spirv-tools/test/val/val_layout_test.cpp
  75. 2 2
      3rdparty/spirv-tools/test/val/val_literals_test.cpp
  76. 1 1
      3rdparty/spirv-tools/test/val/val_memory_test.cpp
  77. 26 26
      3rdparty/spirv-tools/test/val/val_modes_test.cpp
  78. 84 84
      3rdparty/spirv-tools/test/val/val_non_uniform_test.cpp
  79. 1 1
      3rdparty/spirv-tools/test/val/val_ssa_test.cpp
  80. 2 2
      3rdparty/spirv-tools/test/val/val_storage_test.cpp
  81. 4 4
      3rdparty/spirv-tools/test/val/val_version_test.cpp
  82. 3 0
      3rdparty/spirv-tools/tools/reduce/reduce.cpp

+ 2 - 0
3rdparty/spirv-tools/BUILD.gn

@@ -452,6 +452,8 @@ static_library("spvtools_opt") {
     "source/opt/basic_block.h",
     "source/opt/block_merge_pass.cpp",
     "source/opt/block_merge_pass.h",
+    "source/opt/block_merge_util.cpp",
+    "source/opt/block_merge_util.h",
     "source/opt/build_module.cpp",
     "source/opt/build_module.h",
     "source/opt/ccp_pass.cpp",

+ 1 - 1
3rdparty/spirv-tools/include/generated/build-version.inc

@@ -1 +1 @@
-"v2019.2-dev", "SPIRV-Tools v2019.2-dev 3aeb8ce06558847fce74ef8e4a12862a3d29db89"
+"v2019.2-dev", "SPIRV-Tools v2019.2-dev 6bc0c3fb0a18b013fc222ac6173abaff22f65a39"

+ 16 - 0
3rdparty/spirv-tools/source/opt/block_merge_util.cpp

@@ -49,6 +49,20 @@ bool IsMerge(IRContext* context, BasicBlock* block) {
   return IsMerge(context, block->id());
 }
 
+// Removes any OpPhi instructions in |block|, which should have exactly one
+// predecessor, replacing uses of OpPhi ids with the ids associated with the
+// predecessor.
+void EliminateOpPhiInstructions(IRContext* context, BasicBlock* block) {
+  block->ForEachPhiInst([context](Instruction* phi) {
+    assert(2 == phi->NumInOperands() &&
+           "A block can only have one predecessor for block merging to make "
+           "sense.");
+    context->ReplaceAllUsesWith(phi->result_id(),
+                                phi->GetSingleWordInOperand(0));
+    context->KillInst(phi);
+  });
+}
+
 }  // Anonymous namespace
 
 bool CanMergeWithSuccessor(IRContext* context, BasicBlock* block) {
@@ -124,6 +138,8 @@ void MergeWithSuccessor(IRContext* context, Function* func,
     context->set_instr_block(&inst, &*bi);
   }
 
+  EliminateOpPhiInstructions(context, &*sbi);
+
   // Now actually move the instructions.
   bi->AddInstructions(&*sbi);
 

+ 1 - 2
3rdparty/spirv-tools/source/opt/optimizer.cpp

@@ -182,8 +182,7 @@ Optimizer& Optimizer::RegisterPerformancePasses() {
       .RegisterPass(CreateRedundancyEliminationPass())
       .RegisterPass(CreateDeadBranchElimPass())
       .RegisterPass(CreateBlockMergePass())
-      .RegisterPass(CreateSimplificationPass())
-      .RegisterPass(CreateCodeSinkingPass());
+      .RegisterPass(CreateSimplificationPass());
   // Currently exposing driver bugs resulting in crashes (#946)
   // .RegisterPass(CreateCommonUniformElimPass())
 }

+ 4 - 0
3rdparty/spirv-tools/source/reduce/CMakeLists.txt

@@ -14,6 +14,8 @@
 set(SPIRV_TOOLS_REDUCE_SOURCES
         change_operand_reduction_opportunity.h
         change_operand_to_undef_reduction_opportunity.h
+        merge_blocks_reduction_opportunity.h
+        merge_blocks_reduction_opportunity_finder.h
         operand_to_const_reduction_opportunity_finder.h
         operand_to_undef_reduction_opportunity_finder.h
         operand_to_dominating_id_reduction_opportunity_finder.h
@@ -30,6 +32,8 @@ set(SPIRV_TOOLS_REDUCE_SOURCES
 
         change_operand_reduction_opportunity.cpp
         change_operand_to_undef_reduction_opportunity.cpp
+        merge_blocks_reduction_opportunity.cpp
+        merge_blocks_reduction_opportunity_finder.cpp
         operand_to_const_reduction_opportunity_finder.cpp
         operand_to_undef_reduction_opportunity_finder.cpp
         operand_to_dominating_id_reduction_opportunity_finder.cpp

+ 67 - 0
3rdparty/spirv-tools/source/reduce/merge_blocks_reduction_opportunity.cpp

@@ -0,0 +1,67 @@
+// Copyright (c) 2019 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "merge_blocks_reduction_opportunity.h"
+#include "source/opt/block_merge_util.h"
+
+#include "source/opt/ir_context.h"
+
+namespace spvtools {
+namespace reduce {
+
+using namespace opt;
+
+MergeBlocksReductionOpportunity::MergeBlocksReductionOpportunity(
+    IRContext* context, Function* function, BasicBlock* block) {
+  // Precondition: the terminator has to be OpBranch.
+  assert(block->terminator()->opcode() == SpvOpBranch);
+  context_ = context;
+  function_ = function;
+  // Get the successor block associated with the OpBranch.
+  successor_block_ =
+      context->cfg()->block(block->terminator()->GetSingleWordInOperand(0));
+}
+
+bool MergeBlocksReductionOpportunity::PreconditionHolds() {
+  // By construction, it is not possible for the merging of A->B to disable the
+  // merging of C->D, even when B and C are the same block.
+  return true;
+}
+
+void MergeBlocksReductionOpportunity::Apply() {
+  // While the original block that targeted the successor may not exist anymore
+  // (it might have been merged with another block), some block must exist that
+  // targets the successor.  Find it.
+
+  const auto predecessors = context_->cfg()->preds(successor_block_->id());
+  assert(1 == predecessors.size() &&
+         "For a successor to be merged into its predecessor, exactly one "
+         "predecessor must be present.");
+  const uint32_t predecessor_id = predecessors[0];
+
+  for (auto bi = function_->begin(); bi != function_->end(); ++bi) {
+    if (bi->id() == predecessor_id) {
+      blockmergeutil::MergeWithSuccessor(context_, function_, bi);
+      // Block merging changes the control flow graph, so invalidate it.
+      context_->InvalidateAnalysesExceptFor(IRContext::Analysis::kAnalysisNone);
+      return;
+    }
+  }
+
+  assert(false &&
+         "Unreachable: we should have found a block with the desired id.");
+}
+
+}  // namespace reduce
+}  // namespace spvtools

+ 53 - 0
3rdparty/spirv-tools/source/reduce/merge_blocks_reduction_opportunity.h

@@ -0,0 +1,53 @@
+// Copyright (c) 2019 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef SOURCE_REDUCE_MERGE_BLOCKS_REDUCTION_OPPORTUNITY_H_
+#define SOURCE_REDUCE_MERGE_BLOCKS_REDUCTION_OPPORTUNITY_H_
+
+#include "reduction_opportunity.h"
+#include "source/opt/basic_block.h"
+#include "source/opt/function.h"
+
+namespace spvtools {
+namespace reduce {
+
+// An opportunity to merge two blocks into one.
+class MergeBlocksReductionOpportunity : public ReductionOpportunity {
+ public:
+  // Creates the opportunity to merge |block| with its successor, where |block|
+  // is inside |function|, and |context| is the enclosing IR context.
+  MergeBlocksReductionOpportunity(opt::IRContext* context,
+                                  opt::Function* function,
+                                  opt::BasicBlock* block);
+
+  bool PreconditionHolds() override;
+
+ protected:
+  void Apply() override;
+
+ private:
+  opt::IRContext* context_;
+  opt::Function* function_;
+
+  // Rather than holding on to the block that can be merged with its successor,
+  // we hold on to its successor. This is because the predecessor block might
+  // get merged with *its* predecessor, and so will no longer exist, while the
+  // successor will continue to exist until this opportunity gets applied.
+  opt::BasicBlock* successor_block_;
+};
+
+}  // namespace reduce
+}  // namespace spvtools
+
+#endif  // SOURCE_REDUCE_MERGE_BLOCKS_REDUCTION_OPPORTUNITY_H_

+ 48 - 0
3rdparty/spirv-tools/source/reduce/merge_blocks_reduction_opportunity_finder.cpp

@@ -0,0 +1,48 @@
+// Copyright (c) 2019 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "source/reduce/merge_blocks_reduction_opportunity_finder.h"
+#include "source/opt/block_merge_util.h"
+#include "source/reduce/merge_blocks_reduction_opportunity.h"
+
+namespace spvtools {
+namespace reduce {
+
+using namespace opt;
+
+std::string MergeBlocksReductionOpportunityFinder::GetName() const {
+  return "MergeBlocksReductionOpportunityFinder";
+}
+
+std::vector<std::unique_ptr<ReductionOpportunity>>
+MergeBlocksReductionOpportunityFinder::GetAvailableOpportunities(
+    opt::IRContext* context) const {
+  std::vector<std::unique_ptr<ReductionOpportunity>> result;
+
+  // Consider every block in every function.
+  for (auto& function : *context->module()) {
+    for (auto& block : function) {
+      // See whether it is possible to merge this block with its successor.
+      if (blockmergeutil::CanMergeWithSuccessor(context, &block)) {
+        // It is, so record an opportunity to do this.
+        result.push_back(spvtools::MakeUnique<MergeBlocksReductionOpportunity>(
+            context, &function, &block));
+      }
+    }
+  }
+  return result;
+}
+
+}  // namespace reduce
+}  // namespace spvtools

+ 42 - 0
3rdparty/spirv-tools/source/reduce/merge_blocks_reduction_opportunity_finder.h

@@ -0,0 +1,42 @@
+// Copyright (c) 2019 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef SOURCE_REDUCE_MERGE_BLOCKS_REDUCTION_OPPORTUNITY_FINDER_H_
+#define SOURCE_REDUCE_MERGE_BLOCKS_REDUCTION_OPPORTUNITY_FINDER_H_
+
+#include "source/reduce/reduction_opportunity_finder.h"
+
+namespace spvtools {
+namespace reduce {
+
+// A finder of opportunities to merge blocks together.
+class MergeBlocksReductionOpportunityFinder
+    : public ReductionOpportunityFinder {
+ public:
+  MergeBlocksReductionOpportunityFinder() = default;
+
+  ~MergeBlocksReductionOpportunityFinder() override = default;
+
+  std::string GetName() const final;
+
+  std::vector<std::unique_ptr<ReductionOpportunity>> GetAvailableOpportunities(
+      opt::IRContext* context) const final;
+
+ private:
+};
+
+}  // namespace reduce
+}  // namespace spvtools
+
+#endif  // SOURCE_REDUCE_MERGE_BLOCKS_REDUCTION_OPPORTUNITY_FINDER_H_

+ 180 - 1
3rdparty/spirv-tools/source/val/validate_annotation.cpp

@@ -23,6 +23,168 @@ namespace spvtools {
 namespace val {
 namespace {
 
+bool IsValidWebGPUDecoration(uint32_t decoration) {
+  switch (decoration) {
+    case SpvDecorationSpecId:
+    case SpvDecorationBlock:
+    case SpvDecorationRowMajor:
+    case SpvDecorationColMajor:
+    case SpvDecorationArrayStride:
+    case SpvDecorationMatrixStride:
+    case SpvDecorationBuiltIn:
+    case SpvDecorationNoPerspective:
+    case SpvDecorationFlat:
+    case SpvDecorationCentroid:
+    case SpvDecorationRestrict:
+    case SpvDecorationAliased:
+    case SpvDecorationNonWritable:
+    case SpvDecorationNonReadable:
+    case SpvDecorationUniform:
+    case SpvDecorationLocation:
+    case SpvDecorationComponent:
+    case SpvDecorationIndex:
+    case SpvDecorationBinding:
+    case SpvDecorationDescriptorSet:
+    case SpvDecorationOffset:
+    case SpvDecorationNoContraction:
+      return true;
+    default:
+      return false;
+  }
+}
+
+std::string LogStringForDecoration(uint32_t decoration) {
+  switch (decoration) {
+    case SpvDecorationRelaxedPrecision:
+      return "RelaxedPrecision";
+    case SpvDecorationSpecId:
+      return "SpecId";
+    case SpvDecorationBlock:
+      return "Block";
+    case SpvDecorationBufferBlock:
+      return "BufferBlock";
+    case SpvDecorationRowMajor:
+      return "RowMajor";
+    case SpvDecorationColMajor:
+      return "ColMajor";
+    case SpvDecorationArrayStride:
+      return "ArrayStride";
+    case SpvDecorationMatrixStride:
+      return "MatrixStride";
+    case SpvDecorationGLSLShared:
+      return "GLSLShared";
+    case SpvDecorationGLSLPacked:
+      return "GLSLPacked";
+    case SpvDecorationCPacked:
+      return "CPacked";
+    case SpvDecorationBuiltIn:
+      return "BuiltIn";
+    case SpvDecorationNoPerspective:
+      return "NoPerspective";
+    case SpvDecorationFlat:
+      return "Flat";
+    case SpvDecorationPatch:
+      return "Patch";
+    case SpvDecorationCentroid:
+      return "Centroid";
+    case SpvDecorationSample:
+      return "Sample";
+    case SpvDecorationInvariant:
+      return "Invariant";
+    case SpvDecorationRestrict:
+      return "Restrict";
+    case SpvDecorationAliased:
+      return "Aliased";
+    case SpvDecorationVolatile:
+      return "Volatile";
+    case SpvDecorationConstant:
+      return "Constant";
+    case SpvDecorationCoherent:
+      return "Coherent";
+    case SpvDecorationNonWritable:
+      return "NonWritable";
+    case SpvDecorationNonReadable:
+      return "NonReadable";
+    case SpvDecorationUniform:
+      return "Uniform";
+    case SpvDecorationSaturatedConversion:
+      return "SaturatedConversion";
+    case SpvDecorationStream:
+      return "Stream";
+    case SpvDecorationLocation:
+      return "Location";
+    case SpvDecorationComponent:
+      return "Component";
+    case SpvDecorationIndex:
+      return "Index";
+    case SpvDecorationBinding:
+      return "Binding";
+    case SpvDecorationDescriptorSet:
+      return "DescriptorSet";
+    case SpvDecorationOffset:
+      return "Offset";
+    case SpvDecorationXfbBuffer:
+      return "XfbBuffer";
+    case SpvDecorationXfbStride:
+      return "XfbStride";
+    case SpvDecorationFuncParamAttr:
+      return "FuncParamAttr";
+    case SpvDecorationFPRoundingMode:
+      return "FPRoundingMode";
+    case SpvDecorationFPFastMathMode:
+      return "FPFastMathMode";
+    case SpvDecorationLinkageAttributes:
+      return "LinkageAttributes";
+    case SpvDecorationNoContraction:
+      return "NoContraction";
+    case SpvDecorationInputAttachmentIndex:
+      return "InputAttachmentIndex";
+    case SpvDecorationAlignment:
+      return "Alignment";
+    case SpvDecorationMaxByteOffset:
+      return "MaxByteOffset";
+    case SpvDecorationAlignmentId:
+      return "AlignmentId";
+    case SpvDecorationMaxByteOffsetId:
+      return "MaxByteOffsetId";
+    case SpvDecorationNoSignedWrap:
+      return "NoSignedWrap";
+    case SpvDecorationNoUnsignedWrap:
+      return "NoUnsignedWrap";
+    case SpvDecorationExplicitInterpAMD:
+      return "ExplicitInterpAMD";
+    case SpvDecorationOverrideCoverageNV:
+      return "OverrideCoverageNV";
+    case SpvDecorationPassthroughNV:
+      return "PassthroughNV";
+    case SpvDecorationViewportRelativeNV:
+      return "ViewportRelativeNV";
+    case SpvDecorationSecondaryViewportRelativeNV:
+      return "SecondaryViewportRelativeNV";
+    case SpvDecorationPerPrimitiveNV:
+      return "PerPrimitiveNV";
+    case SpvDecorationPerViewNV:
+      return "PerViewNV";
+    case SpvDecorationPerTaskNV:
+      return "PerTaskNV";
+    case SpvDecorationPerVertexNV:
+      return "PerVertexNV";
+    case SpvDecorationNonUniformEXT:
+      return "NonUniformEXT";
+    case SpvDecorationRestrictPointerEXT:
+      return "RestrictPointerEXT";
+    case SpvDecorationAliasedPointerEXT:
+      return "AliasedPointerEXT";
+    case SpvDecorationHlslCounterBufferGOOGLE:
+      return "HlslCounterBufferGOOGLE";
+    case SpvDecorationHlslSemanticGOOGLE:
+      return "HlslSemanticGOOGLE";
+    default:
+      break;
+  }
+  return "Unknown";
+}
+
 spv_result_t ValidateDecorate(ValidationState_t& _, const Instruction* inst) {
   const auto decoration = inst->GetOperandAs<uint32_t>(1);
   if (decoration == SpvDecorationSpecId) {
@@ -31,10 +193,18 @@ spv_result_t ValidateDecorate(ValidationState_t& _, const Instruction* inst) {
     if (!target || !spvOpcodeIsScalarSpecConstant(target->opcode())) {
       return _.diag(SPV_ERROR_INVALID_ID, inst)
              << "OpDecorate SpecId decoration target <id> '"
-             << _.getIdName(decoration)
+             << _.getIdName(target_id)
              << "' is not a scalar specialization constant.";
     }
   }
+
+  if (spvIsWebGPUEnv(_.context()->target_env) &&
+      !IsValidWebGPUDecoration(decoration)) {
+    return _.diag(SPV_ERROR_INVALID_ID, inst)
+           << "OpDecorate decoration '" << LogStringForDecoration(decoration)
+           << "' is not valid for the WebGPU execution environment.";
+  }
+
   // TODO: Add validations for all decorations.
   return SPV_SUCCESS;
 }
@@ -59,6 +229,15 @@ spv_result_t ValidateMemberDecorate(ValidationState_t& _,
            << " is out of bounds. The structure has " << member_count
            << " members. Largest valid index is " << member_count - 1 << ".";
   }
+
+  const auto decoration = inst->GetOperandAs<uint32_t>(2);
+  if (spvIsWebGPUEnv(_.context()->target_env) &&
+      !IsValidWebGPUDecoration(decoration)) {
+    return _.diag(SPV_ERROR_INVALID_ID, inst)
+           << "OpMemberDecorate decoration  '" << _.getIdName(decoration)
+           << "' is not valid for the WebGPU execution environment.";
+  }
+
   return SPV_SUCCESS;
 }
 

+ 172 - 44
3rdparty/spirv-tools/source/val/validate_builtins.cpp

@@ -101,6 +101,28 @@ SpvStorageClass GetStorageClass(const Instruction& inst) {
   return SpvStorageClassMax;
 }
 
+bool IsBuiltInValidForWebGPU(SpvBuiltIn label) {
+  switch (label) {
+    case SpvBuiltInPosition:
+    case SpvBuiltInVertexIndex:
+    case SpvBuiltInInstanceIndex:
+    case SpvBuiltInFrontFacing:
+    case SpvBuiltInFragCoord:
+    case SpvBuiltInFragDepth:
+    case SpvBuiltInNumWorkgroups:
+    case SpvBuiltInWorkgroupSize:
+    case SpvBuiltInLocalInvocationId:
+    case SpvBuiltInGlobalInvocationId:
+    case SpvBuiltInLocalInvocationIndex: {
+      return true;
+    }
+    default:
+      break;
+  }
+
+  return false;
+}
+
 // Helper class managing validation of built-ins.
 // TODO: Generic functionality of this class can be moved into
 // ValidationState_t to be made available to other users.
@@ -169,6 +191,8 @@ class BuiltInsValidator {
                                                const Instruction& inst);
   spv_result_t ValidateVertexIdOrInstanceIdAtDefinition(
       const Decoration& decoration, const Instruction& inst);
+  spv_result_t ValidateLocalInvocationIndexAtDefinition(
+      const Decoration& decoration, const Instruction& inst);
   spv_result_t ValidateWorkgroupSizeAtDefinition(const Decoration& decoration,
                                                  const Instruction& inst);
   // Used for GlobalInvocationId, LocalInvocationId, NumWorkgroups, WorkgroupId.
@@ -267,6 +291,11 @@ class BuiltInsValidator {
       const Instruction& referenced_inst,
       const Instruction& referenced_from_inst);
 
+  spv_result_t ValidateLocalInvocationIndexAtReference(
+      const Decoration& decoration, const Instruction& built_in_inst,
+      const Instruction& referenced_inst,
+      const Instruction& referenced_from_inst);
+
   spv_result_t ValidateVertexIndexAtReference(
       const Decoration& decoration, const Instruction& built_in_inst,
       const Instruction& referenced_inst,
@@ -937,12 +966,14 @@ spv_result_t BuiltInsValidator::ValidateClipOrCullDistanceAtReference(
 
 spv_result_t BuiltInsValidator::ValidateFragCoordAtDefinition(
     const Decoration& decoration, const Instruction& inst) {
-  if (spvIsVulkanEnv(_.context()->target_env)) {
+  if (spvIsVulkanOrWebGPUEnv(_.context()->target_env)) {
     if (spv_result_t error = ValidateF32Vec(
             decoration, inst, 4,
             [this, &inst](const std::string& message) -> spv_result_t {
               return _.diag(SPV_ERROR_INVALID_DATA, &inst)
-                     << "According to the Vulkan spec BuiltIn FragCoord "
+                     << "According to the "
+                     << spvLogStringForEnv(_.context()->target_env)
+                     << " spec BuiltIn FragCoord "
                         "variable needs to be a 4-component 32-bit float "
                         "vector. "
                      << message;
@@ -959,12 +990,13 @@ spv_result_t BuiltInsValidator::ValidateFragCoordAtReference(
     const Decoration& decoration, const Instruction& built_in_inst,
     const Instruction& referenced_inst,
     const Instruction& referenced_from_inst) {
-  if (spvIsVulkanEnv(_.context()->target_env)) {
+  if (spvIsVulkanOrWebGPUEnv(_.context()->target_env)) {
     const SpvStorageClass storage_class = GetStorageClass(referenced_from_inst);
     if (storage_class != SpvStorageClassMax &&
         storage_class != SpvStorageClassInput) {
       return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst)
-             << "Vulkan spec allows BuiltIn FragCoord to be only used for "
+             << spvLogStringForEnv(_.context()->target_env)
+             << " spec allows BuiltIn FragCoord to be only used for "
                 "variables with Input storage class. "
              << GetReferenceDesc(decoration, built_in_inst, referenced_inst,
                                  referenced_from_inst)
@@ -974,7 +1006,8 @@ spv_result_t BuiltInsValidator::ValidateFragCoordAtReference(
     for (const SpvExecutionModel execution_model : execution_models_) {
       if (execution_model != SpvExecutionModelFragment) {
         return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst)
-               << "Vulkan spec allows BuiltIn FragCoord to be used only with "
+               << spvLogStringForEnv(_.context()->target_env)
+               << " spec allows BuiltIn FragCoord to be used only with "
                   "Fragment execution model. "
                << GetReferenceDesc(decoration, built_in_inst, referenced_inst,
                                    referenced_from_inst, execution_model);
@@ -994,12 +1027,14 @@ spv_result_t BuiltInsValidator::ValidateFragCoordAtReference(
 
 spv_result_t BuiltInsValidator::ValidateFragDepthAtDefinition(
     const Decoration& decoration, const Instruction& inst) {
-  if (spvIsVulkanEnv(_.context()->target_env)) {
+  if (spvIsVulkanOrWebGPUEnv(_.context()->target_env)) {
     if (spv_result_t error = ValidateF32(
             decoration, inst,
             [this, &inst](const std::string& message) -> spv_result_t {
               return _.diag(SPV_ERROR_INVALID_DATA, &inst)
-                     << "According to the Vulkan spec BuiltIn FragDepth "
+                     << "According to the "
+                     << spvLogStringForEnv(_.context()->target_env)
+                     << " spec BuiltIn FragDepth "
                         "variable needs to be a 32-bit float scalar. "
                      << message;
             })) {
@@ -1015,12 +1050,13 @@ spv_result_t BuiltInsValidator::ValidateFragDepthAtReference(
     const Decoration& decoration, const Instruction& built_in_inst,
     const Instruction& referenced_inst,
     const Instruction& referenced_from_inst) {
-  if (spvIsVulkanEnv(_.context()->target_env)) {
+  if (spvIsVulkanOrWebGPUEnv(_.context()->target_env)) {
     const SpvStorageClass storage_class = GetStorageClass(referenced_from_inst);
     if (storage_class != SpvStorageClassMax &&
         storage_class != SpvStorageClassOutput) {
       return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst)
-             << "Vulkan spec allows BuiltIn FragDepth to be only used for "
+             << spvLogStringForEnv(_.context()->target_env)
+             << " spec allows BuiltIn FragDepth to be only used for "
                 "variables with Output storage class. "
              << GetReferenceDesc(decoration, built_in_inst, referenced_inst,
                                  referenced_from_inst)
@@ -1030,7 +1066,8 @@ spv_result_t BuiltInsValidator::ValidateFragDepthAtReference(
     for (const SpvExecutionModel execution_model : execution_models_) {
       if (execution_model != SpvExecutionModelFragment) {
         return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst)
-               << "Vulkan spec allows BuiltIn FragDepth to be used only with "
+               << spvLogStringForEnv(_.context()->target_env)
+               << " spec allows BuiltIn FragDepth to be used only with "
                   "Fragment execution model. "
                << GetReferenceDesc(decoration, built_in_inst, referenced_inst,
                                    referenced_from_inst, execution_model);
@@ -1043,7 +1080,8 @@ spv_result_t BuiltInsValidator::ValidateFragDepthAtReference(
       const auto* modes = _.GetExecutionModes(entry_point);
       if (!modes || !modes->count(SpvExecutionModeDepthReplacing)) {
         return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst)
-               << "Vulkan spec requires DepthReplacing execution mode to be "
+               << spvLogStringForEnv(_.context()->target_env)
+               << " spec requires DepthReplacing execution mode to be "
                   "declared when using BuiltIn FragDepth. "
                << GetReferenceDesc(decoration, built_in_inst, referenced_inst,
                                    referenced_from_inst);
@@ -1063,12 +1101,14 @@ spv_result_t BuiltInsValidator::ValidateFragDepthAtReference(
 
 spv_result_t BuiltInsValidator::ValidateFrontFacingAtDefinition(
     const Decoration& decoration, const Instruction& inst) {
-  if (spvIsVulkanEnv(_.context()->target_env)) {
+  if (spvIsVulkanOrWebGPUEnv(_.context()->target_env)) {
     if (spv_result_t error = ValidateBool(
             decoration, inst,
             [this, &inst](const std::string& message) -> spv_result_t {
               return _.diag(SPV_ERROR_INVALID_DATA, &inst)
-                     << "According to the Vulkan spec BuiltIn FrontFacing "
+                     << "According to the "
+                     << spvLogStringForEnv(_.context()->target_env)
+                     << " spec BuiltIn FrontFacing "
                         "variable needs to be a bool scalar. "
                      << message;
             })) {
@@ -1084,12 +1124,13 @@ spv_result_t BuiltInsValidator::ValidateFrontFacingAtReference(
     const Decoration& decoration, const Instruction& built_in_inst,
     const Instruction& referenced_inst,
     const Instruction& referenced_from_inst) {
-  if (spvIsVulkanEnv(_.context()->target_env)) {
+  if (spvIsVulkanOrWebGPUEnv(_.context()->target_env)) {
     const SpvStorageClass storage_class = GetStorageClass(referenced_from_inst);
     if (storage_class != SpvStorageClassMax &&
         storage_class != SpvStorageClassInput) {
       return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst)
-             << "Vulkan spec allows BuiltIn FrontFacing to be only used for "
+             << spvLogStringForEnv(_.context()->target_env)
+             << " spec allows BuiltIn FrontFacing to be only used for "
                 "variables with Input storage class. "
              << GetReferenceDesc(decoration, built_in_inst, referenced_inst,
                                  referenced_from_inst)
@@ -1099,7 +1140,8 @@ spv_result_t BuiltInsValidator::ValidateFrontFacingAtReference(
     for (const SpvExecutionModel execution_model : execution_models_) {
       if (execution_model != SpvExecutionModelFragment) {
         return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst)
-               << "Vulkan spec allows BuiltIn FrontFacing to be used only with "
+               << spvLogStringForEnv(_.context()->target_env)
+               << " spec allows BuiltIn FrontFacing to be used only with "
                   "Fragment execution model. "
                << GetReferenceDesc(decoration, built_in_inst, referenced_inst,
                                    referenced_from_inst, execution_model);
@@ -1233,12 +1275,14 @@ spv_result_t BuiltInsValidator::ValidateInvocationIdAtReference(
 
 spv_result_t BuiltInsValidator::ValidateInstanceIndexAtDefinition(
     const Decoration& decoration, const Instruction& inst) {
-  if (spvIsVulkanEnv(_.context()->target_env)) {
+  if (spvIsVulkanOrWebGPUEnv(_.context()->target_env)) {
     if (spv_result_t error = ValidateI32(
             decoration, inst,
             [this, &inst](const std::string& message) -> spv_result_t {
               return _.diag(SPV_ERROR_INVALID_DATA, &inst)
-                     << "According to the Vulkan spec BuiltIn InstanceIndex "
+                     << "According to the "
+                     << spvLogStringForEnv(_.context()->target_env)
+                     << " spec BuiltIn InstanceIndex "
                         "variable needs to be a 32-bit int scalar. "
                      << message;
             })) {
@@ -1254,12 +1298,13 @@ spv_result_t BuiltInsValidator::ValidateInstanceIndexAtReference(
     const Decoration& decoration, const Instruction& built_in_inst,
     const Instruction& referenced_inst,
     const Instruction& referenced_from_inst) {
-  if (spvIsVulkanEnv(_.context()->target_env)) {
+  if (spvIsVulkanOrWebGPUEnv(_.context()->target_env)) {
     const SpvStorageClass storage_class = GetStorageClass(referenced_from_inst);
     if (storage_class != SpvStorageClassMax &&
         storage_class != SpvStorageClassInput) {
       return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst)
-             << "Vulkan spec allows BuiltIn InstanceIndex to be only used for "
+             << spvLogStringForEnv(_.context()->target_env)
+             << " spec allows BuiltIn InstanceIndex to be only used for "
                 "variables with Input storage class. "
              << GetReferenceDesc(decoration, built_in_inst, referenced_inst,
                                  referenced_from_inst)
@@ -1269,7 +1314,8 @@ spv_result_t BuiltInsValidator::ValidateInstanceIndexAtReference(
     for (const SpvExecutionModel execution_model : execution_models_) {
       if (execution_model != SpvExecutionModelVertex) {
         return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst)
-               << "Vulkan spec allows BuiltIn InstanceIndex to be used only "
+               << spvLogStringForEnv(_.context()->target_env)
+               << " spec allows BuiltIn InstanceIndex to be used only "
                   "with Vertex execution model. "
                << GetReferenceDesc(decoration, built_in_inst, referenced_inst,
                                    referenced_from_inst, execution_model);
@@ -2115,13 +2161,15 @@ spv_result_t BuiltInsValidator::ValidateTessLevelAtReference(
 
 spv_result_t BuiltInsValidator::ValidateVertexIndexAtDefinition(
     const Decoration& decoration, const Instruction& inst) {
-  if (spvIsVulkanEnv(_.context()->target_env)) {
+  if (spvIsVulkanOrWebGPUEnv(_.context()->target_env)) {
     if (spv_result_t error = ValidateI32(
             decoration, inst,
             [this, &inst](const std::string& message) -> spv_result_t {
               return _.diag(SPV_ERROR_INVALID_DATA, &inst)
-                     << "According to the Vulkan spec BuiltIn VertexIndex "
-                        "variable needs to be a 32-bit int scalar. "
+                     << "According to the "
+                     << spvLogStringForEnv(_.context()->target_env)
+                     << " spec BuiltIn VertexIndex variable needs to be a "
+                        "32-bit int scalar. "
                      << message;
             })) {
       return error;
@@ -2183,16 +2231,75 @@ spv_result_t BuiltInsValidator::ValidateInstanceIdAtReference(
   return SPV_SUCCESS;
 }
 
+spv_result_t BuiltInsValidator::ValidateLocalInvocationIndexAtDefinition(
+    const Decoration& decoration, const Instruction& inst) {
+  if (spvIsWebGPUEnv(_.context()->target_env)) {
+    if (spv_result_t error = ValidateI32(
+            decoration, inst,
+            [this, &inst](const std::string& message) -> spv_result_t {
+              return _.diag(SPV_ERROR_INVALID_DATA, &inst)
+                     << "According to the WebGPU spec BuiltIn "
+                        "LocalInvocationIndex variable needs to be a 32-bit "
+                        "int."
+                     << message;
+            })) {
+      return error;
+    }
+  }
+
+  // Seed at reference checks with this built-in.
+  return ValidateLocalInvocationIndexAtReference(decoration, inst, inst, inst);
+}
+
+spv_result_t BuiltInsValidator::ValidateLocalInvocationIndexAtReference(
+    const Decoration& decoration, const Instruction& built_in_inst,
+    const Instruction& referenced_inst,
+    const Instruction& referenced_from_inst) {
+  if (spvIsWebGPUEnv(_.context()->target_env)) {
+    const SpvStorageClass storage_class = GetStorageClass(referenced_from_inst);
+    if (storage_class != SpvStorageClassMax &&
+        storage_class != SpvStorageClassInput) {
+      return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst)
+             << "WebGPU spec allows BuiltIn LocalInvocationIndex to be only "
+                "used for variables with Input storage class. "
+             << GetReferenceDesc(decoration, built_in_inst, referenced_inst,
+                                 referenced_from_inst)
+             << " " << GetStorageClassDesc(referenced_from_inst);
+    }
+
+    for (const SpvExecutionModel execution_model : execution_models_) {
+      if (execution_model != SpvExecutionModelGLCompute) {
+        return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst)
+               << "WebGPU spec allows BuiltIn VertexIndex to be used only "
+                  "with GLCompute execution model. "
+               << GetReferenceDesc(decoration, built_in_inst, referenced_inst,
+                                   referenced_from_inst, execution_model);
+      }
+    }
+  }
+
+  if (function_id_ == 0) {
+    // Propagate this rule to all dependant ids in the global scope.
+    id_to_at_reference_checks_[referenced_from_inst.id()].push_back(
+        std::bind(&BuiltInsValidator::ValidateLocalInvocationIndexAtReference,
+                  this, decoration, built_in_inst, referenced_from_inst,
+                  std::placeholders::_1));
+  }
+
+  return SPV_SUCCESS;
+}
+
 spv_result_t BuiltInsValidator::ValidateVertexIndexAtReference(
     const Decoration& decoration, const Instruction& built_in_inst,
     const Instruction& referenced_inst,
     const Instruction& referenced_from_inst) {
-  if (spvIsVulkanEnv(_.context()->target_env)) {
+  if (spvIsVulkanOrWebGPUEnv(_.context()->target_env)) {
     const SpvStorageClass storage_class = GetStorageClass(referenced_from_inst);
     if (storage_class != SpvStorageClassMax &&
         storage_class != SpvStorageClassInput) {
       return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst)
-             << "Vulkan spec allows BuiltIn VertexIndex to be only used for "
+             << spvLogStringForEnv(_.context()->target_env)
+             << " spec allows BuiltIn VertexIndex to be only used for "
                 "variables with Input storage class. "
              << GetReferenceDesc(decoration, built_in_inst, referenced_inst,
                                  referenced_from_inst)
@@ -2202,8 +2309,8 @@ spv_result_t BuiltInsValidator::ValidateVertexIndexAtReference(
     for (const SpvExecutionModel execution_model : execution_models_) {
       if (execution_model != SpvExecutionModelVertex) {
         return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst)
-               << "Vulkan spec allows BuiltIn VertexIndex to be used only "
-                  "with "
+               << spvLogStringForEnv(_.context()->target_env)
+               << " spec allows BuiltIn VertexIndex to be used only with "
                   "Vertex execution model. "
                << GetReferenceDesc(decoration, built_in_inst, referenced_inst,
                                    referenced_from_inst, execution_model);
@@ -2339,13 +2446,15 @@ spv_result_t BuiltInsValidator::ValidateLayerOrViewportIndexAtReference(
 
 spv_result_t BuiltInsValidator::ValidateComputeShaderI32Vec3InputAtDefinition(
     const Decoration& decoration, const Instruction& inst) {
-  if (spvIsVulkanEnv(_.context()->target_env)) {
+  if (spvIsVulkanOrWebGPUEnv(_.context()->target_env)) {
     if (spv_result_t error = ValidateI32Vec(
             decoration, inst, 3,
             [this, &decoration,
              &inst](const std::string& message) -> spv_result_t {
               return _.diag(SPV_ERROR_INVALID_DATA, &inst)
-                     << "According to the Vulkan spec BuiltIn "
+                     << "According to the "
+                     << spvLogStringForEnv(_.context()->target_env)
+                     << " spec BuiltIn "
                      << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN,
                                                       decoration.params()[0])
                      << " variable needs to be a 3-component 32-bit int "
@@ -2365,12 +2474,13 @@ spv_result_t BuiltInsValidator::ValidateComputeShaderI32Vec3InputAtReference(
     const Decoration& decoration, const Instruction& built_in_inst,
     const Instruction& referenced_inst,
     const Instruction& referenced_from_inst) {
-  if (spvIsVulkanEnv(_.context()->target_env)) {
+  if (spvIsVulkanOrWebGPUEnv(_.context()->target_env)) {
     const SpvStorageClass storage_class = GetStorageClass(referenced_from_inst);
     if (storage_class != SpvStorageClassMax &&
         storage_class != SpvStorageClassInput) {
       return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst)
-             << "Vulkan spec allows BuiltIn "
+             << spvLogStringForEnv(_.context()->target_env)
+             << " spec allows BuiltIn "
              << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN,
                                               decoration.params()[0])
              << " to be only used for variables with Input storage class. "
@@ -2380,11 +2490,15 @@ spv_result_t BuiltInsValidator::ValidateComputeShaderI32Vec3InputAtReference(
     }
 
     for (const SpvExecutionModel execution_model : execution_models_) {
-      if (execution_model != SpvExecutionModelGLCompute &&
-          execution_model != SpvExecutionModelTaskNV &&
-          execution_model != SpvExecutionModelMeshNV) {
+      bool has_vulkan_model = execution_model == SpvExecutionModelGLCompute ||
+                              execution_model == SpvExecutionModelTaskNV ||
+                              execution_model == SpvExecutionModelMeshNV;
+      bool has_webgpu_model = execution_model == SpvExecutionModelGLCompute;
+      if ((spvIsVulkanEnv(_.context()->target_env) && !has_vulkan_model) ||
+          (spvIsWebGPUEnv(_.context()->target_env) && !has_webgpu_model)) {
         return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst)
-               << "Vulkan spec allows BuiltIn "
+               << spvLogStringForEnv(_.context()->target_env)
+               << " spec allows BuiltIn "
                << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN,
                                                 decoration.params()[0])
                << " to be used only with GLCompute execution model. "
@@ -2407,8 +2521,9 @@ spv_result_t BuiltInsValidator::ValidateComputeShaderI32Vec3InputAtReference(
 
 spv_result_t BuiltInsValidator::ValidateWorkgroupSizeAtDefinition(
     const Decoration& decoration, const Instruction& inst) {
-  if (spvIsVulkanEnv(_.context()->target_env)) {
-    if (!spvOpcodeIsConstant(inst.opcode())) {
+  if (spvIsVulkanOrWebGPUEnv(_.context()->target_env)) {
+    if (spvIsVulkanEnv(_.context()->target_env) &&
+        !spvOpcodeIsConstant(inst.opcode())) {
       return _.diag(SPV_ERROR_INVALID_DATA, &inst)
              << "Vulkan spec requires BuiltIn WorkgroupSize to be a "
                 "constant. "
@@ -2419,9 +2534,10 @@ spv_result_t BuiltInsValidator::ValidateWorkgroupSizeAtDefinition(
             decoration, inst, 3,
             [this, &inst](const std::string& message) -> spv_result_t {
               return _.diag(SPV_ERROR_INVALID_DATA, &inst)
-                     << "According to the Vulkan spec BuiltIn WorkgroupSize "
-                        "variable "
-                        "needs to be a 3-component 32-bit int vector. "
+                     << "According to the "
+                     << spvLogStringForEnv(_.context()->target_env)
+                     << " spec BuiltIn WorkgroupSize variable needs to be a "
+                        "3-component 32-bit int vector. "
                      << message;
             })) {
       return error;
@@ -2436,11 +2552,12 @@ spv_result_t BuiltInsValidator::ValidateWorkgroupSizeAtReference(
     const Decoration& decoration, const Instruction& built_in_inst,
     const Instruction& referenced_inst,
     const Instruction& referenced_from_inst) {
-  if (spvIsVulkanEnv(_.context()->target_env)) {
+  if (spvIsVulkanOrWebGPUEnv(_.context()->target_env)) {
     for (const SpvExecutionModel execution_model : execution_models_) {
       if (execution_model != SpvExecutionModelGLCompute) {
         return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst)
-               << "Vulkan spec allows BuiltIn "
+               << spvLogStringForEnv(_.context()->target_env)
+               << " spec allows BuiltIn "
                << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN,
                                                 decoration.params()[0])
                << " to be used only with GLCompute execution model. "
@@ -2463,6 +2580,15 @@ spv_result_t BuiltInsValidator::ValidateWorkgroupSizeAtReference(
 spv_result_t BuiltInsValidator::ValidateSingleBuiltInAtDefinition(
     const Decoration& decoration, const Instruction& inst) {
   const SpvBuiltIn label = SpvBuiltIn(decoration.params()[0]);
+
+  if (spvIsWebGPUEnv(_.context()->target_env) &&
+      !IsBuiltInValidForWebGPU(label)) {
+    return _.diag(SPV_ERROR_INVALID_DATA, &inst)
+           << "WebGPU does not allow BuiltIn "
+           << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN,
+                                            decoration.params()[0]);
+  }
+
   // If you are adding a new BuiltIn enum, please register it here.
   // If the newly added enum has validation rules associated with it
   // consider leaving a TODO and/or creating an issue.
@@ -2542,7 +2668,9 @@ spv_result_t BuiltInsValidator::ValidateSingleBuiltInAtDefinition(
     case SpvBuiltInInstanceId: {
       return ValidateVertexIdOrInstanceIdAtDefinition(decoration, inst);
     }
-    case SpvBuiltInLocalInvocationIndex:
+    case SpvBuiltInLocalInvocationIndex: {
+      return ValidateLocalInvocationIndexAtDefinition(decoration, inst);
+    }
     case SpvBuiltInWorkDim:
     case SpvBuiltInGlobalSize:
     case SpvBuiltInEnqueuedWorkgroupSize:

+ 54 - 0
3rdparty/spirv-tools/source/val/validate_decorations.cpp

@@ -950,6 +950,14 @@ spv_result_t CheckDecorationsOfBuffers(ValidationState_t& vstate) {
           const bool bufferRules =
               (uniform && bufferDeco) || (push_constant && blockDeco) ||
               ((storage_buffer || phys_storage_buffer) && blockDeco);
+          if (uniform && blockDeco) {
+            vstate.RegisterPointerToUniformBlock(ptrInst->id());
+            vstate.RegisterStructForUniformBlock(id);
+          }
+          if ((uniform && bufferDeco) || (storage_buffer && blockDeco)) {
+            vstate.RegisterPointerToStorageBuffer(ptrInst->id());
+            vstate.RegisterStructForStorageBuffer(id);
+          }
           if (blockRules || bufferRules) {
             const char* deco_str = blockDeco ? "Block" : "BufferBlock";
             spv_result_t recursive_status = SPV_SUCCESS;
@@ -1219,6 +1227,49 @@ spv_result_t CheckFPRoundingModeForShaders(ValidationState_t& vstate,
   return SPV_SUCCESS;
 }
 
+// Returns SPV_SUCCESS if validation rules are satisfied for the NonWritable
+// decoration.  Otherwise emits a diagnostic and returns something other than
+// SPV_SUCCESS.  The |inst| parameter is the object being decorated.  This must
+// be called after TypePass and AnnotateCheckDecorationsOfBuffers are called.
+spv_result_t CheckNonWritableDecoration(ValidationState_t& vstate,
+                                        const Instruction& inst,
+                                        const Decoration& decoration) {
+  assert(inst.id() && "Parser ensures the target of the decoration has an ID");
+
+  if (decoration.struct_member_index() == Decoration::kInvalidMember) {
+    // The target must be a memory object declaration.
+    // First, it must be a variable or function parameter.
+    if (inst.opcode() != SpvOpVariable &&
+        inst.opcode() != SpvOpFunctionParameter) {
+      return vstate.diag(SPV_ERROR_INVALID_ID, &inst)
+             << "Target of NonWritable decoration must be a memory object "
+                "declaration (a variable or a function parameter)";
+    }
+    // Second, it must point to a UBO, SSBO, or storage image.
+    const auto type_id = inst.type_id();
+    if (!vstate.IsPointerToUniformBlock(type_id) &&
+        !vstate.IsPointerToStorageBuffer(type_id) &&
+        !vstate.IsPointerToStorageImage(type_id)) {
+      return vstate.diag(SPV_ERROR_INVALID_ID, &inst)
+             << "Target of NonWritable decoration is invalid: must point to a "
+                "storage image, uniform block, or storage buffer";
+    }
+  } else {
+    // The target is a struct member.  The annotations pass already checks that
+    // it is a structure.  So now fall through to ensure that the structure is
+    // used as a UBO or SSBO.
+    const auto type_id = inst.id();
+    if (!vstate.IsStructForUniformBlock(type_id) &&
+        !vstate.IsStructForStorageBuffer(type_id)) {
+      return vstate.diag(SPV_ERROR_INVALID_ID, &inst)
+             << "Target of NonWritable member decoration is invalid: must be "
+                "the struct type of a uniform block or storage buffer";
+    }
+  }
+
+  return SPV_SUCCESS;
+}
+
 // Returns SPV_SUCCESS if validation rules are satisfied for Uniform
 // decorations. Otherwise emits a diagnostic and returns something other than
 // SPV_SUCCESS. Assumes each decoration on a group has been propagated down to
@@ -1314,6 +1365,9 @@ spv_result_t CheckDecorationsFromDecoration(ValidationState_t& vstate) {
           if (is_shader)
             PASS_OR_BAIL(CheckFPRoundingModeForShaders(vstate, *inst));
           break;
+        case SpvDecorationNonWritable:
+          PASS_OR_BAIL(CheckNonWritableDecoration(vstate, *inst, decoration));
+          break;
         case SpvDecorationUniform:
           PASS_OR_BAIL(CheckUniformDecoration(vstate, *inst, decoration));
           break;

+ 10 - 0
3rdparty/spirv-tools/source/val/validate_type.cpp

@@ -269,6 +269,16 @@ spv_result_t ValidateTypePointer(ValidationState_t& _,
            << "OpTypePointer Type <id> '" << _.getIdName(type_id)
            << "' is not a type.";
   }
+  // See if this points to a storage image.
+  if (type->opcode() == SpvOpTypeImage) {
+    const auto storage_class = inst->GetOperandAs<uint32_t>(1);
+    if (storage_class == SpvStorageClassUniformConstant) {
+      const auto sampled = type->GetOperandAs<uint32_t>(6);
+      // 2 indicates this image is known to be be used without a sampler, i.e.
+      // a storage image.
+      if (sampled == 2) _.RegisterPointerToStorageImage(inst->id());
+    }
+  }
   return SPV_SUCCESS;
 }
 

+ 74 - 0
3rdparty/spirv-tools/source/val/validation_state.h

@@ -562,6 +562,63 @@ class ValidationState_t {
   bool GetPointerTypeInfo(uint32_t id, uint32_t* data_type,
                           uint32_t* storage_class) const;
 
+  // Is the ID the type of a pointer to a uniform block: Block-decorated struct
+  // in uniform storage class? The result is only valid after internal method
+  // CheckDecorationsOfBuffers has been called.
+  bool IsPointerToUniformBlock(uint32_t type_id) const {
+    return pointer_to_uniform_block_.find(type_id) !=
+           pointer_to_uniform_block_.cend();
+  }
+  // Save the ID of a pointer to uniform block.
+  void RegisterPointerToUniformBlock(uint32_t type_id) {
+    pointer_to_uniform_block_.insert(type_id);
+  }
+  // Is the ID the type of a struct used as a uniform block?
+  // The result is only valid after internal method CheckDecorationsOfBuffers
+  // has been called.
+  bool IsStructForUniformBlock(uint32_t type_id) const {
+    return struct_for_uniform_block_.find(type_id) !=
+           struct_for_uniform_block_.cend();
+  }
+  // Save the ID of a struct of a uniform block.
+  void RegisterStructForUniformBlock(uint32_t type_id) {
+    struct_for_uniform_block_.insert(type_id);
+  }
+  // Is the ID the type of a pointer to a storage buffer: BufferBlock-decorated
+  // struct in uniform storage class, or Block-decorated struct in StorageBuffer
+  // storage class? The result is only valid after internal method
+  // CheckDecorationsOfBuffers has been called.
+  bool IsPointerToStorageBuffer(uint32_t type_id) const {
+    return pointer_to_storage_buffer_.find(type_id) !=
+           pointer_to_storage_buffer_.cend();
+  }
+  // Save the ID of a pointer to a storage buffer.
+  void RegisterPointerToStorageBuffer(uint32_t type_id) {
+    pointer_to_storage_buffer_.insert(type_id);
+  }
+  // Is the ID the type of a struct for storage buffer?
+  // The result is only valid after internal method CheckDecorationsOfBuffers
+  // has been called.
+  bool IsStructForStorageBuffer(uint32_t type_id) const {
+    return struct_for_storage_buffer_.find(type_id) !=
+           struct_for_storage_buffer_.cend();
+  }
+  // Save the ID of a struct of a storage buffer.
+  void RegisterStructForStorageBuffer(uint32_t type_id) {
+    struct_for_storage_buffer_.insert(type_id);
+  }
+
+  // Is the ID the type of a pointer to a storage image?  That is, the pointee
+  // type is an image type which is known to not use a sampler.
+  bool IsPointerToStorageImage(uint32_t type_id) const {
+    return pointer_to_storage_image_.find(type_id) !=
+           pointer_to_storage_image_.cend();
+  }
+  // Save the ID of a pointer to a storage image.
+  void RegisterPointerToStorageImage(uint32_t type_id) {
+    pointer_to_storage_image_.insert(type_id);
+  }
+
   // Tries to evaluate a 32-bit signed or unsigned scalar integer constant.
   // Returns tuple <is_int32, is_const_int32, value>.
   // OpSpecConstant* return |is_const_int32| as false since their values cannot
@@ -701,6 +758,23 @@ class ValidationState_t {
   std::unordered_map<uint32_t, std::vector<uint32_t>> function_to_entry_points_;
   const std::vector<uint32_t> empty_ids_;
 
+  // The IDs of types of pointers to Block-decorated structs in Uniform storage
+  // class. This is populated at the start of ValidateDecorations.
+  std::unordered_set<uint32_t> pointer_to_uniform_block_;
+  // The IDs of struct types for uniform blocks.
+  // This is populated at the start of ValidateDecorations.
+  std::unordered_set<uint32_t> struct_for_uniform_block_;
+  // The IDs of types of pointers to BufferBlock-decorated structs in Uniform
+  // storage class, or Block-decorated structs in StorageBuffer storage class.
+  // This is populated at the start of ValidateDecorations.
+  std::unordered_set<uint32_t> pointer_to_storage_buffer_;
+  // The IDs of struct types for storage buffers.
+  // This is populated at the start of ValidateDecorations.
+  std::unordered_set<uint32_t> struct_for_storage_buffer_;
+  // The IDs of types of pointers to storage images.  This is populated in the
+  // TypePass.
+  std::unordered_set<uint32_t> pointer_to_storage_image_;
+
   /// Maps ids to friendly names.
   std::unique_ptr<spvtools::FriendlyNameMapper> friendly_mapper_;
   spvtools::NameMapper name_mapper_;

+ 2 - 2
3rdparty/spirv-tools/test/assembly_context_test.cpp

@@ -46,7 +46,7 @@ TEST_P(EncodeStringTest, Sample) {
 }
 
 // clang-format off
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     BinaryEncodeString, EncodeStringTest,
     ::testing::ValuesIn(std::vector<EncodeStringCase>{
       // Use cases that exercise at least one to two words,
@@ -70,7 +70,7 @@ INSTANTIATE_TEST_CASE_P(
       // A very long string, encoded after an initial word.
       // SPIR-V limits strings to 65535 characters.
       {std::string(65535, 'a'), {1}},
-    }),);
+    }));
 // clang-format on
 
 }  // namespace

+ 6 - 6
3rdparty/spirv-tools/test/binary_parse_test.cpp

@@ -561,7 +561,7 @@ TEST_P(BinaryParseWordsAndCountDiagnosticTest, WordAndCountCases) {
   EXPECT_THAT(diagnostic->error, Eq(GetParam().expected_diagnostic));
 }
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     BinaryParseDiagnostic, BinaryParseWordsAndCountDiagnosticTest,
     ::testing::ValuesIn(std::vector<WordsAndCountDiagnosticCase>{
         {nullptr, 0, "Missing module."},
@@ -575,7 +575,7 @@ INSTANTIATE_TEST_CASE_P(
          "Module has incomplete header: only 3 words instead of 5"},
         {kHeaderForBound1, 4,
          "Module has incomplete header: only 4 words instead of 5"},
-    }), );
+    }));
 
 // A binary parser diagnostic test case where a vector of words is
 // provided.  We'll use this to express cases that can't be created
@@ -598,7 +598,7 @@ TEST_P(BinaryParseWordVectorDiagnosticTest, WordVectorCases) {
   EXPECT_THAT(diagnostic->error, Eq(GetParam().expected_diagnostic));
 }
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     BinaryParseDiagnostic, BinaryParseWordVectorDiagnosticTest,
     ::testing::ValuesIn(std::vector<WordVectorDiagnosticCase>{
         {Concatenate({ExpectedHeaderForBound(1), {spvOpcodeMake(0, SpvOpNop)}}),
@@ -816,7 +816,7 @@ INSTANTIATE_TEST_CASE_P(
              MakeInstruction(SpvOpConstant, {1, 2, 42}),
          }),
          "Type Id 1 is not a scalar numeric type"},
-    }), );
+    }));
 
 // A binary parser diagnostic case generated from an assembly text input.
 struct AssemblyDiagnosticCase {
@@ -836,7 +836,7 @@ TEST_P(BinaryParseAssemblyDiagnosticTest, AssemblyCases) {
   EXPECT_THAT(diagnostic->error, Eq(GetParam().expected_diagnostic));
 }
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     BinaryParseDiagnostic, BinaryParseAssemblyDiagnosticTest,
     ::testing::ValuesIn(std::vector<AssemblyDiagnosticCase>{
         {"%1 = OpConstant !0 42", "Error: Type Id is 0"},
@@ -886,7 +886,7 @@ INSTANTIATE_TEST_CASE_P(
          "Invalid image operand: 32770 has invalid mask component 32768"},
         {"OpSelectionMerge %1 !7",
          "Invalid selection control operand: 7 has invalid mask component 4"},
-    }), );
+    }));
 
 }  // namespace
 }  // namespace spvtools

+ 4 - 4
3rdparty/spirv-tools/test/binary_to_text.literal_test.cpp

@@ -32,7 +32,7 @@ TEST_P(RoundTripLiteralsTest, Sample) {
 }
 
 // clang-format off
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     StringLiterals, RoundTripLiteralsTest,
     ::testing::ValuesIn(std::vector<std::string>{
         "OpName %1 \"\"\n",           // empty
@@ -49,7 +49,7 @@ INSTANTIATE_TEST_CASE_P(
         "OpName %1 \"\\\"foo\nbar\\\"\"\n",       // escaped quote
         "OpName %1 \"\\\\foo\nbar\\\\\"\n",       // escaped backslash
         "OpName %1 \"\xE4\xBA\xB2\"\n",             // UTF-8
-    }),);
+    }));
 // clang-format on
 
 using RoundTripSpecialCaseLiteralsTest = spvtest::TextToBinaryTestBase<
@@ -63,13 +63,13 @@ TEST_P(RoundTripSpecialCaseLiteralsTest, Sample) {
 }
 
 // clang-format off
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     StringLiterals, RoundTripSpecialCaseLiteralsTest,
     ::testing::ValuesIn(std::vector<std::pair<std::string, std::string>>{
       {"OpName %1 \"\\foo\"\n", "OpName %1 \"foo\"\n"}, // Escape f
       {"OpName %1 \"\\\nfoo\"\n", "OpName %1 \"\nfoo\"\n"}, // Escape newline
       {"OpName %1 \"\\\xE4\xBA\xB2\"\n", "OpName %1 \"\xE4\xBA\xB2\"\n"}, // Escape utf-8
-    }),);
+    }));
 // clang-format on
 
 }  // namespace

+ 47 - 47
3rdparty/spirv-tools/test/binary_to_text_test.cpp

@@ -171,7 +171,7 @@ TEST_P(BinaryToTextFail, EncodeSuccessfullyDecodeFailed) {
               Eq(GetParam().expected_error_message));
 }
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     InvalidIds, BinaryToTextFail,
     ::testing::ValuesIn(std::vector<FailedDecodeCase>{
         {"", spvtest::MakeInstruction(SpvOpTypeVoid, {0}),
@@ -196,9 +196,9 @@ INSTANTIATE_TEST_CASE_P(
          "%2 = OpTypeVector %1 4",
          spvtest::MakeInstruction(SpvOpConstant, {2, 3, 999}),
          "Type Id 2 is not a scalar numeric type"},
-    }), );
+    }));
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     InvalidIdsCheckedDuringLiteralCaseParsing, BinaryToTextFail,
     ::testing::ValuesIn(std::vector<FailedDecodeCase>{
         {"", spvtest::MakeInstruction(SpvOpSwitch, {1, 2, 3, 4}),
@@ -212,7 +212,7 @@ INSTANTIATE_TEST_CASE_P(
         {"%1 = OpTypeFloat 32\n%2 = OpConstant %1 1.5",
          spvtest::MakeInstruction(SpvOpSwitch, {2, 3, 4, 5}),
          "Invalid OpSwitch: selector id 2 is not a scalar integer"},
-    }), );
+    }));
 
 TEST_F(TextToBinaryTest, OneInstruction) {
   const std::string input = "OpSource OpenCL_C 12\n";
@@ -243,7 +243,7 @@ TEST_P(RoundTripInstructionsTest, Sample) {
 }
 
 // clang-format off
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     NumericLiterals, RoundTripInstructionsTest,
     // This test is independent of environment, so just test the one.
     Combine(::testing::Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1,
@@ -275,10 +275,10 @@ INSTANTIATE_TEST_CASE_P(
                 "%1 = OpTypeFloat 64\n%2 = OpConstant %1 -0x1.0002p+1024\n", // NaN
                 "%1 = OpTypeFloat 64\n%2 = OpConstant %1 0x1p+1024\n", // Inf
                 "%1 = OpTypeFloat 64\n%2 = OpConstant %1 -0x1p+1024\n", // -Inf
-            })), );
+            })));
 // clang-format on
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     MemoryAccessMasks, RoundTripInstructionsTest,
     Combine(::testing::Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1,
                               SPV_ENV_UNIVERSAL_1_2, SPV_ENV_UNIVERSAL_1_3),
@@ -292,9 +292,9 @@ INSTANTIATE_TEST_CASE_P(
                 "OpStore %1 %2 Volatile|Aligned 16\n",
                 "OpStore %1 %2 Volatile|Nontemporal\n",
                 "OpStore %1 %2 Volatile|Aligned|Nontemporal 32\n",
-            })), );
+            })));
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     FPFastMathModeMasks, RoundTripInstructionsTest,
     Combine(
         ::testing::Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1,
@@ -310,9 +310,9 @@ INSTANTIATE_TEST_CASE_P(
             "OpDecorate %1 FPFastMathMode NotNaN|NotInf\n",
             "OpDecorate %1 FPFastMathMode NSZ|AllowRecip\n",
             "OpDecorate %1 FPFastMathMode NotNaN|NotInf|NSZ|AllowRecip|Fast\n",
-        })), );
+        })));
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     LoopControlMasks, RoundTripInstructionsTest,
     Combine(::testing::Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1,
                               SPV_ENV_UNIVERSAL_1_3, SPV_ENV_UNIVERSAL_1_2),
@@ -321,18 +321,18 @@ INSTANTIATE_TEST_CASE_P(
                 "OpLoopMerge %1 %2 Unroll\n",
                 "OpLoopMerge %1 %2 DontUnroll\n",
                 "OpLoopMerge %1 %2 Unroll|DontUnroll\n",
-            })), );
-
-INSTANTIATE_TEST_CASE_P(LoopControlMasksV11, RoundTripInstructionsTest,
-                        Combine(::testing::Values(SPV_ENV_UNIVERSAL_1_1,
-                                                  SPV_ENV_UNIVERSAL_1_2,
-                                                  SPV_ENV_UNIVERSAL_1_3),
-                                ::testing::ValuesIn(std::vector<std::string>{
-                                    "OpLoopMerge %1 %2 DependencyInfinite\n",
-                                    "OpLoopMerge %1 %2 DependencyLength 8\n",
-                                })), );
-
-INSTANTIATE_TEST_CASE_P(
+            })));
+
+INSTANTIATE_TEST_SUITE_P(LoopControlMasksV11, RoundTripInstructionsTest,
+                         Combine(::testing::Values(SPV_ENV_UNIVERSAL_1_1,
+                                                   SPV_ENV_UNIVERSAL_1_2,
+                                                   SPV_ENV_UNIVERSAL_1_3),
+                                 ::testing::ValuesIn(std::vector<std::string>{
+                                     "OpLoopMerge %1 %2 DependencyInfinite\n",
+                                     "OpLoopMerge %1 %2 DependencyLength 8\n",
+                                 })));
+
+INSTANTIATE_TEST_SUITE_P(
     SelectionControlMasks, RoundTripInstructionsTest,
     Combine(::testing::Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1,
                               SPV_ENV_UNIVERSAL_1_3, SPV_ENV_UNIVERSAL_1_2),
@@ -341,9 +341,9 @@ INSTANTIATE_TEST_CASE_P(
                 "OpSelectionMerge %1 Flatten\n",
                 "OpSelectionMerge %1 DontFlatten\n",
                 "OpSelectionMerge %1 Flatten|DontFlatten\n",
-            })), );
+            })));
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     FunctionControlMasks, RoundTripInstructionsTest,
     Combine(::testing::Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1,
                               SPV_ENV_UNIVERSAL_1_2, SPV_ENV_UNIVERSAL_1_3),
@@ -355,9 +355,9 @@ INSTANTIATE_TEST_CASE_P(
                 "%2 = OpFunction %1 Const %3\n",
                 "%2 = OpFunction %1 Inline|Pure|Const %3\n",
                 "%2 = OpFunction %1 DontInline|Const %3\n",
-            })), );
+            })));
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     ImageMasks, RoundTripInstructionsTest,
     Combine(::testing::Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1,
                               SPV_ENV_UNIVERSAL_1_2, SPV_ENV_UNIVERSAL_1_3),
@@ -378,9 +378,9 @@ INSTANTIATE_TEST_CASE_P(
                 "%2 = OpImageFetch %1 %3 %4 Sample|MinLod %5 %6\n",
                 "%2 = OpImageFetch %1 %3 %4"
                 " Bias|Lod|Grad|ConstOffset|Offset|ConstOffsets|Sample|MinLod"
-                " %5 %6 %7 %8 %9 %10 %11 %12 %13\n"})), );
+                " %5 %6 %7 %8 %9 %10 %11 %12 %13\n"})));
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     NewInstructionsInSPIRV1_2, RoundTripInstructionsTest,
     Combine(::testing::Values(SPV_ENV_UNIVERSAL_1_2, SPV_ENV_UNIVERSAL_1_3),
             ::testing::ValuesIn(std::vector<std::string>{
@@ -389,7 +389,7 @@ INSTANTIATE_TEST_CASE_P(
                 "OpExecutionModeId %1 LocalSizeHintId %2\n",
                 "OpDecorateId %1 AlignmentId %2\n",
                 "OpDecorateId %1 MaxByteOffsetId %2\n",
-            })), );
+            })));
 
 using MaskSorting = TextToBinaryTest;
 
@@ -537,23 +537,23 @@ TEST_P(GeneratorStringTest, Sample) {
   spvTextDestroy(decoded_text);
 }
 
-INSTANTIATE_TEST_CASE_P(GeneratorStrings, GeneratorStringTest,
-                        ::testing::ValuesIn(std::vector<GeneratorStringCase>{
-                            {SPV_GENERATOR_KHRONOS, 12, "Khronos; 12"},
-                            {SPV_GENERATOR_LUNARG, 99, "LunarG; 99"},
-                            {SPV_GENERATOR_VALVE, 1, "Valve; 1"},
-                            {SPV_GENERATOR_CODEPLAY, 65535, "Codeplay; 65535"},
-                            {SPV_GENERATOR_NVIDIA, 19, "NVIDIA; 19"},
-                            {SPV_GENERATOR_ARM, 1000, "ARM; 1000"},
-                            {SPV_GENERATOR_KHRONOS_LLVM_TRANSLATOR, 38,
-                             "Khronos LLVM/SPIR-V Translator; 38"},
-                            {SPV_GENERATOR_KHRONOS_ASSEMBLER, 2,
-                             "Khronos SPIR-V Tools Assembler; 2"},
-                            {SPV_GENERATOR_KHRONOS_GLSLANG, 1,
-                             "Khronos Glslang Reference Front End; 1"},
-                            {1000, 18, "Unknown(1000); 18"},
-                            {65535, 32767, "Unknown(65535); 32767"},
-                        }), );
+INSTANTIATE_TEST_SUITE_P(GeneratorStrings, GeneratorStringTest,
+                         ::testing::ValuesIn(std::vector<GeneratorStringCase>{
+                             {SPV_GENERATOR_KHRONOS, 12, "Khronos; 12"},
+                             {SPV_GENERATOR_LUNARG, 99, "LunarG; 99"},
+                             {SPV_GENERATOR_VALVE, 1, "Valve; 1"},
+                             {SPV_GENERATOR_CODEPLAY, 65535, "Codeplay; 65535"},
+                             {SPV_GENERATOR_NVIDIA, 19, "NVIDIA; 19"},
+                             {SPV_GENERATOR_ARM, 1000, "ARM; 1000"},
+                             {SPV_GENERATOR_KHRONOS_LLVM_TRANSLATOR, 38,
+                              "Khronos LLVM/SPIR-V Translator; 38"},
+                             {SPV_GENERATOR_KHRONOS_ASSEMBLER, 2,
+                              "Khronos SPIR-V Tools Assembler; 2"},
+                             {SPV_GENERATOR_KHRONOS_GLSLANG, 1,
+                              "Khronos Glslang Reference Front End; 1"},
+                             {1000, 18, "Unknown(1000); 18"},
+                             {65535, 32767, "Unknown(65535); 32767"},
+                         }));
 
 // TODO(dneto): Test new instructions and enums in SPIR-V 1.3
 

+ 6 - 6
3rdparty/spirv-tools/test/comp/markv_codec_test.cpp

@@ -817,12 +817,12 @@ OpFunctionEnd
 )");
 }
 
-INSTANTIATE_TEST_CASE_P(AllMarkvModels, MarkvTest,
-                        ::testing::ValuesIn(std::vector<MarkvModelType>{
-                            kMarkvModelShaderLite,
-                            kMarkvModelShaderMid,
-                            kMarkvModelShaderMax,
-                        }), );
+INSTANTIATE_TEST_SUITE_P(AllMarkvModels, MarkvTest,
+                         ::testing::ValuesIn(std::vector<MarkvModelType>{
+                             kMarkvModelShaderLite,
+                             kMarkvModelShaderMid,
+                             kMarkvModelShaderMax,
+                         }));
 
 }  // namespace
 }  // namespace comp

+ 18 - 18
3rdparty/spirv-tools/test/enum_set_test.cpp

@@ -267,24 +267,24 @@ TEST_P(CapabilitySetForEachTest, OperatorEqualsSelfAssign) {
   EXPECT_THAT(ElementsIn(assigned), Eq(GetParam().expected));
 }
 
-INSTANTIATE_TEST_CASE_P(Samples, CapabilitySetForEachTest,
-                        ValuesIn(std::vector<ForEachCase>{
-                            {{}, {}},
-                            {{SpvCapabilityMatrix}, {SpvCapabilityMatrix}},
-                            {{SpvCapabilityKernel, SpvCapabilityShader},
-                             {SpvCapabilityShader, SpvCapabilityKernel}},
-                            {{static_cast<SpvCapability>(999)},
-                             {static_cast<SpvCapability>(999)}},
-                            {{static_cast<SpvCapability>(0x7fffffff)},
-                             {static_cast<SpvCapability>(0x7fffffff)}},
-                            // Mixture and out of order
-                            {{static_cast<SpvCapability>(0x7fffffff),
-                              static_cast<SpvCapability>(100),
-                              SpvCapabilityShader, SpvCapabilityMatrix},
-                             {SpvCapabilityMatrix, SpvCapabilityShader,
-                              static_cast<SpvCapability>(100),
-                              static_cast<SpvCapability>(0x7fffffff)}},
-                        }), );
+INSTANTIATE_TEST_SUITE_P(Samples, CapabilitySetForEachTest,
+                         ValuesIn(std::vector<ForEachCase>{
+                             {{}, {}},
+                             {{SpvCapabilityMatrix}, {SpvCapabilityMatrix}},
+                             {{SpvCapabilityKernel, SpvCapabilityShader},
+                              {SpvCapabilityShader, SpvCapabilityKernel}},
+                             {{static_cast<SpvCapability>(999)},
+                              {static_cast<SpvCapability>(999)}},
+                             {{static_cast<SpvCapability>(0x7fffffff)},
+                              {static_cast<SpvCapability>(0x7fffffff)}},
+                             // Mixture and out of order
+                             {{static_cast<SpvCapability>(0x7fffffff),
+                               static_cast<SpvCapability>(100),
+                               SpvCapabilityShader, SpvCapabilityMatrix},
+                              {SpvCapabilityMatrix, SpvCapabilityShader,
+                               static_cast<SpvCapability>(100),
+                               static_cast<SpvCapability>(0x7fffffff)}},
+                         }));
 
 }  // namespace
 }  // namespace spvtools

+ 8 - 8
3rdparty/spirv-tools/test/enum_string_mapping_test.cpp

@@ -64,7 +64,7 @@ TEST_P(CapabilityTest, TestCapabilityToString) {
   EXPECT_EQ(capability_str, result_str);
 }
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     AllExtensions, ExtensionTest,
     ValuesIn(std::vector<std::pair<Extension, std::string>>({
         {Extension::kSPV_KHR_16bit_storage, "SPV_KHR_16bit_storage"},
@@ -89,13 +89,13 @@ INSTANTIATE_TEST_CASE_P(
         {Extension::kSPV_KHR_8bit_storage, "SPV_KHR_8bit_storage"},
     })));
 
-INSTANTIATE_TEST_CASE_P(UnknownExtensions, UnknownExtensionTest,
-                        Values("", "SPV_KHR_", "SPV_KHR_device_group_ERROR",
-                               /*alphabetically before all extensions*/ "A",
-                               /*alphabetically after all extensions*/ "Z",
-                               "SPV_ERROR_random_string_hfsdklhlktherh"));
+INSTANTIATE_TEST_SUITE_P(UnknownExtensions, UnknownExtensionTest,
+                         Values("", "SPV_KHR_", "SPV_KHR_device_group_ERROR",
+                                /*alphabetically before all extensions*/ "A",
+                                /*alphabetically after all extensions*/ "Z",
+                                "SPV_ERROR_random_string_hfsdklhlktherh"));
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     AllCapabilities, CapabilityTest,
     ValuesIn(std::vector<std::pair<SpvCapability, std::string>>(
         {{SpvCapabilityMatrix, "Matrix"},
@@ -189,7 +189,7 @@ INSTANTIATE_TEST_CASE_P(
           "ShaderViewportIndexLayerEXT"},
          {SpvCapabilityShaderViewportMaskNV, "ShaderViewportMaskNV"},
          {SpvCapabilityShaderStereoViewNV, "ShaderStereoViewNV"},
-         {SpvCapabilityPerViewAttributesNV, "PerViewAttributesNV"}})), );
+         {SpvCapabilityPerViewAttributesNV, "PerViewAttributesNV"}})));
 
 }  // namespace
 }  // namespace spvtools

+ 225 - 223
3rdparty/spirv-tools/test/ext_inst.debuginfo_test.cpp

@@ -368,30 +368,30 @@ TEST_P(ExtInstDebugInfoRoundTripTest, ParameterizedExtInst) {
   }
 
 // DebugInfo 4.1 Absent Debugging Information
-INSTANTIATE_TEST_CASE_P(DebugInfoDebugInfoNone, ExtInstDebugInfoRoundTripTest,
-                        ::testing::ValuesIn(std::vector<InstructionCase>({
-                            CASE_0(InfoNone),  // enum value 0
-                        })), );
+INSTANTIATE_TEST_SUITE_P(DebugInfoDebugInfoNone, ExtInstDebugInfoRoundTripTest,
+                         ::testing::ValuesIn(std::vector<InstructionCase>({
+                             CASE_0(InfoNone),  // enum value 0
+                         })));
 
 // DebugInfo 4.2 Compilation Unit
-INSTANTIATE_TEST_CASE_P(DebugInfoDebugCompilationUnit,
-                        ExtInstDebugInfoRoundTripTest,
-                        ::testing::ValuesIn(std::vector<InstructionCase>({
-                            CASE_ILL(CompilationUnit, 100, 42),
-                        })), );
+INSTANTIATE_TEST_SUITE_P(DebugInfoDebugCompilationUnit,
+                         ExtInstDebugInfoRoundTripTest,
+                         ::testing::ValuesIn(std::vector<InstructionCase>({
+                             CASE_ILL(CompilationUnit, 100, 42),
+                         })));
 
 // DebugInfo 4.3 Type instructions
-INSTANTIATE_TEST_CASE_P(DebugInfoDebugTypeBasic, ExtInstDebugInfoRoundTripTest,
-                        ::testing::ValuesIn(std::vector<InstructionCase>({
-                            CASE_IIE(TypeBasic, Unspecified),
-                            CASE_IIE(TypeBasic, Address),
-                            CASE_IIE(TypeBasic, Boolean),
-                            CASE_IIE(TypeBasic, Float),
-                            CASE_IIE(TypeBasic, Signed),
-                            CASE_IIE(TypeBasic, SignedChar),
-                            CASE_IIE(TypeBasic, Unsigned),
-                            CASE_IIE(TypeBasic, UnsignedChar),
-                        })), );
+INSTANTIATE_TEST_SUITE_P(DebugInfoDebugTypeBasic, ExtInstDebugInfoRoundTripTest,
+                         ::testing::ValuesIn(std::vector<InstructionCase>({
+                             CASE_IIE(TypeBasic, Unspecified),
+                             CASE_IIE(TypeBasic, Address),
+                             CASE_IIE(TypeBasic, Boolean),
+                             CASE_IIE(TypeBasic, Float),
+                             CASE_IIE(TypeBasic, Signed),
+                             CASE_IIE(TypeBasic, SignedChar),
+                             CASE_IIE(TypeBasic, Unsigned),
+                             CASE_IIE(TypeBasic, UnsignedChar),
+                         })));
 
 // The FlagIsPublic is value is (1 << 0) | (1 << 2) which is the same
 // as the bitwise-OR of FlagIsProtected and FlagIsPrivate.
@@ -417,7 +417,7 @@ TEST_F(ExtInstDebugInfoRoundTripTestExplicit, FlagIsPublic) {
   EXPECT_THAT(EncodeAndDecodeSuccessfully(input), Eq(expected)) << input;
 }
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     DebugInfoDebugTypePointer, ExtInstDebugInfoRoundTripTest,
     ::testing::ValuesIn(std::vector<InstructionCase>({
 
@@ -463,49 +463,50 @@ INSTANTIATE_TEST_CASE_P(
                 uint32_t(DebugInfoFlagIndirectVariable) |
                 uint32_t(DebugInfoFlagIsOptimized)),
 
-    })), );
-
-INSTANTIATE_TEST_CASE_P(DebugInfoDebugTypeQualifier,
-                        ExtInstDebugInfoRoundTripTest,
-                        ::testing::ValuesIn(std::vector<InstructionCase>({
-                            CASE_IE(TypeQualifier, ConstType),
-                            CASE_IE(TypeQualifier, VolatileType),
-                            CASE_IE(TypeQualifier, RestrictType),
-                        })), );
-
-INSTANTIATE_TEST_CASE_P(DebugInfoDebugTypeArray, ExtInstDebugInfoRoundTripTest,
-                        ::testing::ValuesIn(std::vector<InstructionCase>({
-                            CASE_II(TypeArray),
-                            CASE_III(TypeArray),
-                            CASE_IIII(TypeArray),
-                            CASE_IIIII(TypeArray),
-                        })), );
-
-INSTANTIATE_TEST_CASE_P(DebugInfoDebugTypeVector, ExtInstDebugInfoRoundTripTest,
-                        ::testing::ValuesIn(std::vector<InstructionCase>({
-                            CASE_IL(TypeVector, 2),
-                            CASE_IL(TypeVector, 3),
-                            CASE_IL(TypeVector, 4),
-                            CASE_IL(TypeVector, 16),
-                        })), );
-
-INSTANTIATE_TEST_CASE_P(DebugInfoDebugTypedef, ExtInstDebugInfoRoundTripTest,
-                        ::testing::ValuesIn(std::vector<InstructionCase>({
-                            CASE_IIILLI(Typedef, 12, 13),
-                            CASE_IIILLI(Typedef, 14, 99),
-                        })), );
-
-INSTANTIATE_TEST_CASE_P(DebugInfoDebugTypeFunction,
-                        ExtInstDebugInfoRoundTripTest,
-                        ::testing::ValuesIn(std::vector<InstructionCase>({
-                            CASE_I(TypeFunction),
-                            CASE_II(TypeFunction),
-                            CASE_III(TypeFunction),
-                            CASE_IIII(TypeFunction),
-                            CASE_IIIII(TypeFunction),
-                        })), );
-
-INSTANTIATE_TEST_CASE_P(
+    })));
+
+INSTANTIATE_TEST_SUITE_P(DebugInfoDebugTypeQualifier,
+                         ExtInstDebugInfoRoundTripTest,
+                         ::testing::ValuesIn(std::vector<InstructionCase>({
+                             CASE_IE(TypeQualifier, ConstType),
+                             CASE_IE(TypeQualifier, VolatileType),
+                             CASE_IE(TypeQualifier, RestrictType),
+                         })));
+
+INSTANTIATE_TEST_SUITE_P(DebugInfoDebugTypeArray, ExtInstDebugInfoRoundTripTest,
+                         ::testing::ValuesIn(std::vector<InstructionCase>({
+                             CASE_II(TypeArray),
+                             CASE_III(TypeArray),
+                             CASE_IIII(TypeArray),
+                             CASE_IIIII(TypeArray),
+                         })));
+
+INSTANTIATE_TEST_SUITE_P(DebugInfoDebugTypeVector,
+                         ExtInstDebugInfoRoundTripTest,
+                         ::testing::ValuesIn(std::vector<InstructionCase>({
+                             CASE_IL(TypeVector, 2),
+                             CASE_IL(TypeVector, 3),
+                             CASE_IL(TypeVector, 4),
+                             CASE_IL(TypeVector, 16),
+                         })));
+
+INSTANTIATE_TEST_SUITE_P(DebugInfoDebugTypedef, ExtInstDebugInfoRoundTripTest,
+                         ::testing::ValuesIn(std::vector<InstructionCase>({
+                             CASE_IIILLI(Typedef, 12, 13),
+                             CASE_IIILLI(Typedef, 14, 99),
+                         })));
+
+INSTANTIATE_TEST_SUITE_P(DebugInfoDebugTypeFunction,
+                         ExtInstDebugInfoRoundTripTest,
+                         ::testing::ValuesIn(std::vector<InstructionCase>({
+                             CASE_I(TypeFunction),
+                             CASE_II(TypeFunction),
+                             CASE_III(TypeFunction),
+                             CASE_IIII(TypeFunction),
+                             CASE_IIIII(TypeFunction),
+                         })));
+
+INSTANTIATE_TEST_SUITE_P(
     DebugInfoDebugTypeEnum, ExtInstDebugInfoRoundTripTest,
     ::testing::ValuesIn(std::vector<InstructionCase>({
         CASE_IIILLIIFII(
@@ -518,9 +519,9 @@ INSTANTIATE_TEST_CASE_P(
                           uint32_t(DebugInfoFlagStaticMember)),
         CASE_IIILLIIFIIIIII(TypeEnum, 99, 1, "FlagStaticMember",
                             uint32_t(DebugInfoFlagStaticMember)),
-    })), );
+    })));
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     DebugInfoDebugTypeComposite, ExtInstDebugInfoRoundTripTest,
     ::testing::ValuesIn(std::vector<InstructionCase>({
         CASE_IEILLIIF(
@@ -545,22 +546,22 @@ INSTANTIATE_TEST_CASE_P(
                          uint32_t(DebugInfoFlagIsPrivate)),
         CASE_IEILLIIFIIII(TypeComposite, Class, 9, 10, "FlagIsPrivate",
                           uint32_t(DebugInfoFlagIsPrivate)),
-    })), );
-
-INSTANTIATE_TEST_CASE_P(DebugInfoDebugTypeMember, ExtInstDebugInfoRoundTripTest,
-                        ::testing::ValuesIn(std::vector<InstructionCase>({
-                            CASE_IIILLIIIF(TypeMember, 12, 13, "FlagIsPrivate",
-                                           uint32_t(DebugInfoFlagIsPrivate)),
-                            CASE_IIILLIIIF(TypeMember, 99, 100,
-                                           "FlagIsPrivate|FlagFwdDecl",
-                                           uint32_t(DebugInfoFlagIsPrivate) |
-                                               uint32_t(DebugInfoFlagFwdDecl)),
-                            // Add the optional Id argument.
-                            CASE_IIILLIIIFI(TypeMember, 12, 13, "FlagIsPrivate",
-                                            uint32_t(DebugInfoFlagIsPrivate)),
-                        })), );
-
-INSTANTIATE_TEST_CASE_P(
+    })));
+
+INSTANTIATE_TEST_SUITE_P(
+    DebugInfoDebugTypeMember, ExtInstDebugInfoRoundTripTest,
+    ::testing::ValuesIn(std::vector<InstructionCase>({
+        CASE_IIILLIIIF(TypeMember, 12, 13, "FlagIsPrivate",
+                       uint32_t(DebugInfoFlagIsPrivate)),
+        CASE_IIILLIIIF(TypeMember, 99, 100, "FlagIsPrivate|FlagFwdDecl",
+                       uint32_t(DebugInfoFlagIsPrivate) |
+                           uint32_t(DebugInfoFlagFwdDecl)),
+        // Add the optional Id argument.
+        CASE_IIILLIIIFI(TypeMember, 12, 13, "FlagIsPrivate",
+                        uint32_t(DebugInfoFlagIsPrivate)),
+    })));
+
+INSTANTIATE_TEST_SUITE_P(
     DebugInfoDebugTypeInheritance, ExtInstDebugInfoRoundTripTest,
     ::testing::ValuesIn(std::vector<InstructionCase>({
         CASE_IIIIF(TypeInheritance, "FlagIsPrivate",
@@ -568,53 +569,53 @@ INSTANTIATE_TEST_CASE_P(
         CASE_IIIIF(TypeInheritance, "FlagIsPrivate|FlagFwdDecl",
                    uint32_t(DebugInfoFlagIsPrivate) |
                        uint32_t(DebugInfoFlagFwdDecl)),
-    })), );
+    })));
 
-INSTANTIATE_TEST_CASE_P(DebugInfoDebugTypePtrToMember,
-                        ExtInstDebugInfoRoundTripTest,
-                        ::testing::ValuesIn(std::vector<InstructionCase>({
-                            CASE_II(TypePtrToMember),
-                        })), );
+INSTANTIATE_TEST_SUITE_P(DebugInfoDebugTypePtrToMember,
+                         ExtInstDebugInfoRoundTripTest,
+                         ::testing::ValuesIn(std::vector<InstructionCase>({
+                             CASE_II(TypePtrToMember),
+                         })));
 
 // DebugInfo 4.4 Templates
 
-INSTANTIATE_TEST_CASE_P(DebugInfoDebugTypeTemplate,
-                        ExtInstDebugInfoRoundTripTest,
-                        ::testing::ValuesIn(std::vector<InstructionCase>({
-                            CASE_II(TypeTemplate),
-                            CASE_III(TypeTemplate),
-                            CASE_IIII(TypeTemplate),
-                            CASE_IIIII(TypeTemplate),
-                        })), );
-
-INSTANTIATE_TEST_CASE_P(DebugInfoDebugTypeTemplateParameter,
-                        ExtInstDebugInfoRoundTripTest,
-                        ::testing::ValuesIn(std::vector<InstructionCase>({
-                            CASE_IIIILL(TypeTemplateParameter, 1, 2),
-                            CASE_IIIILL(TypeTemplateParameter, 99, 102),
-                            CASE_IIIILL(TypeTemplateParameter, 10, 7),
-                        })), );
-
-INSTANTIATE_TEST_CASE_P(DebugInfoDebugTypeTemplateTemplateParameter,
-                        ExtInstDebugInfoRoundTripTest,
-                        ::testing::ValuesIn(std::vector<InstructionCase>({
-                            CASE_IIILL(TypeTemplateTemplateParameter, 1, 2),
-                            CASE_IIILL(TypeTemplateTemplateParameter, 99, 102),
-                            CASE_IIILL(TypeTemplateTemplateParameter, 10, 7),
-                        })), );
-
-INSTANTIATE_TEST_CASE_P(DebugInfoDebugTypeTemplateParameterPack,
-                        ExtInstDebugInfoRoundTripTest,
-                        ::testing::ValuesIn(std::vector<InstructionCase>({
-                            CASE_IILLI(TypeTemplateParameterPack, 1, 2),
-                            CASE_IILLII(TypeTemplateParameterPack, 99, 102),
-                            CASE_IILLIII(TypeTemplateParameterPack, 10, 7),
-                            CASE_IILLIIII(TypeTemplateParameterPack, 10, 7),
-                        })), );
+INSTANTIATE_TEST_SUITE_P(DebugInfoDebugTypeTemplate,
+                         ExtInstDebugInfoRoundTripTest,
+                         ::testing::ValuesIn(std::vector<InstructionCase>({
+                             CASE_II(TypeTemplate),
+                             CASE_III(TypeTemplate),
+                             CASE_IIII(TypeTemplate),
+                             CASE_IIIII(TypeTemplate),
+                         })));
+
+INSTANTIATE_TEST_SUITE_P(DebugInfoDebugTypeTemplateParameter,
+                         ExtInstDebugInfoRoundTripTest,
+                         ::testing::ValuesIn(std::vector<InstructionCase>({
+                             CASE_IIIILL(TypeTemplateParameter, 1, 2),
+                             CASE_IIIILL(TypeTemplateParameter, 99, 102),
+                             CASE_IIIILL(TypeTemplateParameter, 10, 7),
+                         })));
+
+INSTANTIATE_TEST_SUITE_P(DebugInfoDebugTypeTemplateTemplateParameter,
+                         ExtInstDebugInfoRoundTripTest,
+                         ::testing::ValuesIn(std::vector<InstructionCase>({
+                             CASE_IIILL(TypeTemplateTemplateParameter, 1, 2),
+                             CASE_IIILL(TypeTemplateTemplateParameter, 99, 102),
+                             CASE_IIILL(TypeTemplateTemplateParameter, 10, 7),
+                         })));
+
+INSTANTIATE_TEST_SUITE_P(DebugInfoDebugTypeTemplateParameterPack,
+                         ExtInstDebugInfoRoundTripTest,
+                         ::testing::ValuesIn(std::vector<InstructionCase>({
+                             CASE_IILLI(TypeTemplateParameterPack, 1, 2),
+                             CASE_IILLII(TypeTemplateParameterPack, 99, 102),
+                             CASE_IILLIII(TypeTemplateParameterPack, 10, 7),
+                             CASE_IILLIIII(TypeTemplateParameterPack, 10, 7),
+                         })));
 
 // DebugInfo 4.5 Global Variables
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     DebugInfoDebugGlobalVariable, ExtInstDebugInfoRoundTripTest,
     ::testing::ValuesIn(std::vector<InstructionCase>({
         CASE_IIILLIIIF(GlobalVariable, 1, 2, "FlagIsOptimized",
@@ -625,20 +626,20 @@ INSTANTIATE_TEST_CASE_P(
                         uint32_t(DebugInfoFlagIsOptimized)),
         CASE_IIILLIIIFI(GlobalVariable, 42, 43, "FlagIsOptimized",
                         uint32_t(DebugInfoFlagIsOptimized)),
-    })), );
+    })));
 
 // DebugInfo 4.6 Functions
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     DebugInfoDebugFunctionDeclaration, ExtInstDebugInfoRoundTripTest,
     ::testing::ValuesIn(std::vector<InstructionCase>({
         CASE_IIILLIIF(FunctionDeclaration, 1, 2, "FlagIsOptimized",
                       uint32_t(DebugInfoFlagIsOptimized)),
         CASE_IIILLIIF(FunctionDeclaration, 42, 43, "FlagFwdDecl",
                       uint32_t(DebugInfoFlagFwdDecl)),
-    })), );
+    })));
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     DebugInfoDebugFunction, ExtInstDebugInfoRoundTripTest,
     ::testing::ValuesIn(std::vector<InstructionCase>({
         CASE_IIILLIIFLI(Function, 1, 2, "FlagIsOptimized",
@@ -650,65 +651,65 @@ INSTANTIATE_TEST_CASE_P(
                          uint32_t(DebugInfoFlagIsOptimized), 3),
         CASE_IIILLIIFLII(Function, 42, 43, "FlagFwdDecl",
                          uint32_t(DebugInfoFlagFwdDecl), 44),
-    })), );
+    })));
 
 // DebugInfo 4.7 Local Information
 
-INSTANTIATE_TEST_CASE_P(DebugInfoDebugLexicalBlock,
-                        ExtInstDebugInfoRoundTripTest,
-                        ::testing::ValuesIn(std::vector<InstructionCase>({
-                            CASE_ILLII(LexicalBlock, 1, 2),
-                            CASE_ILLII(LexicalBlock, 42, 43),
-                        })), );
-
-INSTANTIATE_TEST_CASE_P(DebugInfoDebugLexicalBlockDiscriminator,
-                        ExtInstDebugInfoRoundTripTest,
-                        ::testing::ValuesIn(std::vector<InstructionCase>({
-                            CASE_ILI(LexicalBlockDiscriminator, 1),
-                            CASE_ILI(LexicalBlockDiscriminator, 42),
-                        })), );
-
-INSTANTIATE_TEST_CASE_P(DebugInfoDebugScope, ExtInstDebugInfoRoundTripTest,
-                        ::testing::ValuesIn(std::vector<InstructionCase>({
-                            CASE_I(Scope),
-                            CASE_II(Scope),
-                        })), );
-
-INSTANTIATE_TEST_CASE_P(DebugInfoDebugNoScope, ExtInstDebugInfoRoundTripTest,
-                        ::testing::ValuesIn(std::vector<InstructionCase>({
-                            CASE_0(NoScope),
-                        })), );
-
-INSTANTIATE_TEST_CASE_P(DebugInfoDebugInlinedAt, ExtInstDebugInfoRoundTripTest,
-                        ::testing::ValuesIn(std::vector<InstructionCase>({
-                            CASE_LII(InlinedAt, 1),
-                            CASE_LII(InlinedAt, 42),
-                        })), );
+INSTANTIATE_TEST_SUITE_P(DebugInfoDebugLexicalBlock,
+                         ExtInstDebugInfoRoundTripTest,
+                         ::testing::ValuesIn(std::vector<InstructionCase>({
+                             CASE_ILLII(LexicalBlock, 1, 2),
+                             CASE_ILLII(LexicalBlock, 42, 43),
+                         })));
+
+INSTANTIATE_TEST_SUITE_P(DebugInfoDebugLexicalBlockDiscriminator,
+                         ExtInstDebugInfoRoundTripTest,
+                         ::testing::ValuesIn(std::vector<InstructionCase>({
+                             CASE_ILI(LexicalBlockDiscriminator, 1),
+                             CASE_ILI(LexicalBlockDiscriminator, 42),
+                         })));
+
+INSTANTIATE_TEST_SUITE_P(DebugInfoDebugScope, ExtInstDebugInfoRoundTripTest,
+                         ::testing::ValuesIn(std::vector<InstructionCase>({
+                             CASE_I(Scope),
+                             CASE_II(Scope),
+                         })));
+
+INSTANTIATE_TEST_SUITE_P(DebugInfoDebugNoScope, ExtInstDebugInfoRoundTripTest,
+                         ::testing::ValuesIn(std::vector<InstructionCase>({
+                             CASE_0(NoScope),
+                         })));
+
+INSTANTIATE_TEST_SUITE_P(DebugInfoDebugInlinedAt, ExtInstDebugInfoRoundTripTest,
+                         ::testing::ValuesIn(std::vector<InstructionCase>({
+                             CASE_LII(InlinedAt, 1),
+                             CASE_LII(InlinedAt, 42),
+                         })));
 
 // DebugInfo 4.8 Local Variables
 
-INSTANTIATE_TEST_CASE_P(DebugInfoDebugLocalVariable,
-                        ExtInstDebugInfoRoundTripTest,
-                        ::testing::ValuesIn(std::vector<InstructionCase>({
-                            CASE_IIILLI(LocalVariable, 1, 2),
-                            CASE_IIILLI(LocalVariable, 42, 43),
-                            CASE_IIILLIL(LocalVariable, 1, 2, 3),
-                            CASE_IIILLIL(LocalVariable, 42, 43, 44),
-                        })), );
-
-INSTANTIATE_TEST_CASE_P(DebugInfoDebugInlinedVariable,
-                        ExtInstDebugInfoRoundTripTest,
-                        ::testing::ValuesIn(std::vector<InstructionCase>({
-                            CASE_II(InlinedVariable),
-                        })), );
-
-INSTANTIATE_TEST_CASE_P(DebugInfoDebugDebugDeclare,
-                        ExtInstDebugInfoRoundTripTest,
-                        ::testing::ValuesIn(std::vector<InstructionCase>({
-                            CASE_III(Declare),
-                        })), );
-
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(DebugInfoDebugLocalVariable,
+                         ExtInstDebugInfoRoundTripTest,
+                         ::testing::ValuesIn(std::vector<InstructionCase>({
+                             CASE_IIILLI(LocalVariable, 1, 2),
+                             CASE_IIILLI(LocalVariable, 42, 43),
+                             CASE_IIILLIL(LocalVariable, 1, 2, 3),
+                             CASE_IIILLIL(LocalVariable, 42, 43, 44),
+                         })));
+
+INSTANTIATE_TEST_SUITE_P(DebugInfoDebugInlinedVariable,
+                         ExtInstDebugInfoRoundTripTest,
+                         ::testing::ValuesIn(std::vector<InstructionCase>({
+                             CASE_II(InlinedVariable),
+                         })));
+
+INSTANTIATE_TEST_SUITE_P(DebugInfoDebugDebugDeclare,
+                         ExtInstDebugInfoRoundTripTest,
+                         ::testing::ValuesIn(std::vector<InstructionCase>({
+                             CASE_III(Declare),
+                         })));
+
+INSTANTIATE_TEST_SUITE_P(
     DebugInfoDebugDebugValue, ExtInstDebugInfoRoundTripTest,
     ::testing::ValuesIn(std::vector<InstructionCase>({
         CASE_III(Value),
@@ -717,53 +718,54 @@ INSTANTIATE_TEST_CASE_P(
         CASE_IIIIII(Value),
         // Test up to 4 id parameters. We can always try more.
         CASE_IIIIIII(Value),
-    })), );
-
-INSTANTIATE_TEST_CASE_P(DebugInfoDebugDebugOperation,
-                        ExtInstDebugInfoRoundTripTest,
-                        ::testing::ValuesIn(std::vector<InstructionCase>({
-                            CASE_E(Operation, Deref),
-                            CASE_E(Operation, Plus),
-                            CASE_E(Operation, Minus),
-                            CASE_EL(Operation, PlusUconst, 1),
-                            CASE_EL(Operation, PlusUconst, 42),
-                            CASE_ELL(Operation, BitPiece, 1, 2),
-                            CASE_ELL(Operation, BitPiece, 4, 5),
-                            CASE_E(Operation, Swap),
-                            CASE_E(Operation, Xderef),
-                            CASE_E(Operation, StackValue),
-                            CASE_EL(Operation, Constu, 1),
-                            CASE_EL(Operation, Constu, 42),
-                        })), );
-
-INSTANTIATE_TEST_CASE_P(DebugInfoDebugDebugExpression,
-                        ExtInstDebugInfoRoundTripTest,
-                        ::testing::ValuesIn(std::vector<InstructionCase>({
-                            CASE_0(Expression),
-                            CASE_I(Expression),
-                            CASE_II(Expression),
-                            CASE_III(Expression),
-                            CASE_IIII(Expression),
-                            CASE_IIIII(Expression),
-                            CASE_IIIIII(Expression),
-                            CASE_IIIIIII(Expression),
-                        })), );
+    })));
+
+INSTANTIATE_TEST_SUITE_P(DebugInfoDebugDebugOperation,
+                         ExtInstDebugInfoRoundTripTest,
+                         ::testing::ValuesIn(std::vector<InstructionCase>({
+                             CASE_E(Operation, Deref),
+                             CASE_E(Operation, Plus),
+                             CASE_E(Operation, Minus),
+                             CASE_EL(Operation, PlusUconst, 1),
+                             CASE_EL(Operation, PlusUconst, 42),
+                             CASE_ELL(Operation, BitPiece, 1, 2),
+                             CASE_ELL(Operation, BitPiece, 4, 5),
+                             CASE_E(Operation, Swap),
+                             CASE_E(Operation, Xderef),
+                             CASE_E(Operation, StackValue),
+                             CASE_EL(Operation, Constu, 1),
+                             CASE_EL(Operation, Constu, 42),
+                         })));
+
+INSTANTIATE_TEST_SUITE_P(DebugInfoDebugDebugExpression,
+                         ExtInstDebugInfoRoundTripTest,
+                         ::testing::ValuesIn(std::vector<InstructionCase>({
+                             CASE_0(Expression),
+                             CASE_I(Expression),
+                             CASE_II(Expression),
+                             CASE_III(Expression),
+                             CASE_IIII(Expression),
+                             CASE_IIIII(Expression),
+                             CASE_IIIIII(Expression),
+                             CASE_IIIIIII(Expression),
+                         })));
 
 // DebugInfo 4.9 Macros
 
-INSTANTIATE_TEST_CASE_P(DebugInfoDebugMacroDef, ExtInstDebugInfoRoundTripTest,
-                        ::testing::ValuesIn(std::vector<InstructionCase>({
-                            CASE_ILI(MacroDef, 1),
-                            CASE_ILI(MacroDef, 42),
-                            CASE_ILII(MacroDef, 1),
-                            CASE_ILII(MacroDef, 42),
-                        })), );
-
-INSTANTIATE_TEST_CASE_P(DebugInfoDebugMacroUndef, ExtInstDebugInfoRoundTripTest,
-                        ::testing::ValuesIn(std::vector<InstructionCase>({
-                            CASE_ILI(MacroUndef, 1),
-                            CASE_ILI(MacroUndef, 42),
-                        })), );
+INSTANTIATE_TEST_SUITE_P(DebugInfoDebugMacroDef, ExtInstDebugInfoRoundTripTest,
+                         ::testing::ValuesIn(std::vector<InstructionCase>({
+                             CASE_ILI(MacroDef, 1),
+                             CASE_ILI(MacroDef, 42),
+                             CASE_ILII(MacroDef, 1),
+                             CASE_ILII(MacroDef, 42),
+                         })));
+
+INSTANTIATE_TEST_SUITE_P(DebugInfoDebugMacroUndef,
+                         ExtInstDebugInfoRoundTripTest,
+                         ::testing::ValuesIn(std::vector<InstructionCase>({
+                             CASE_ILI(MacroUndef, 1),
+                             CASE_ILI(MacroUndef, 42),
+                         })));
 
 #undef CASE_0
 #undef CASE_ILL

+ 2 - 2
3rdparty/spirv-tools/test/ext_inst.glsl_test.cpp

@@ -106,7 +106,7 @@ OpFunctionEnd
   spvContextDestroy(context);
 }
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     ExtInstParameters, ExtInstGLSLstd450RoundTripTest,
     ::testing::ValuesIn(std::vector<ExtInstContext>({
         // We are only testing the correctness of encoding and decoding here.
@@ -198,7 +198,7 @@ INSTANTIATE_TEST_CASE_P(
         {"NMin", "%5 %5", 79, 7, {5, 5}},
         {"NMax", "%5 %5", 80, 7, {5, 5}},
         {"NClamp", "%5 %5 %5", 81, 8, {5, 5, 5}},
-    })), );
+    })));
 
 }  // namespace
 }  // namespace spvtools

+ 18 - 18
3rdparty/spirv-tools/test/ext_inst.opencl_test.cpp

@@ -90,7 +90,7 @@ TEST_P(ExtInstOpenCLStdRoundTripTest, ParameterizedExtInst) {
 
 // clang-format off
 // OpenCL.std: 2.1 Math extended instructions
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     OpenCLMath, ExtInstOpenCLStdRoundTripTest,
     ::testing::ValuesIn(std::vector<InstructionCase>({
         // We are only testing the correctness of encoding and decoding here.
@@ -190,10 +190,10 @@ INSTANTIATE_TEST_CASE_P(
         CASE1(Native_sin, native_sin),
         CASE1(Native_sqrt, native_sqrt),
         CASE1(Native_tan, native_tan), // enum value 94
-    })),);
+    })));
 
 // OpenCL.std: 2.1 Integer instructions
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     OpenCLInteger, ExtInstOpenCLStdRoundTripTest,
     ::testing::ValuesIn(std::vector<InstructionCase>({
         CASE1(SAbs, s_abs), // enum value 141
@@ -230,10 +230,10 @@ INSTANTIATE_TEST_CASE_P(
         CASE2(UAbs_diff, u_abs_diff),
         CASE2(UMul_hi, u_mul_hi),
         CASE3(UMad_hi, u_mad_hi), // enum value 204
-    })),);
+    })));
 
 // OpenCL.std: 2.3 Common instrucitons
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     OpenCLCommon, ExtInstOpenCLStdRoundTripTest,
     ::testing::ValuesIn(std::vector<InstructionCase>({
         CASE3(FClamp, fclamp), // enum value 95
@@ -245,10 +245,10 @@ INSTANTIATE_TEST_CASE_P(
         CASE2(Step, step),
         CASE3(Smoothstep, smoothstep),
         CASE1(Sign, sign), // enum value 103
-    })),);
+    })));
 
 // OpenCL.std: 2.4 Geometric instructions
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     OpenCLGeometric, ExtInstOpenCLStdRoundTripTest,
     ::testing::ValuesIn(std::vector<InstructionCase>({
         CASE2(Cross, cross), // enum value 104
@@ -258,18 +258,18 @@ INSTANTIATE_TEST_CASE_P(
         CASE2(Fast_distance, fast_distance),
         CASE1(Fast_length, fast_length),
         CASE1(Fast_normalize, fast_normalize), // enum value 110
-    })),);
+    })));
 
 // OpenCL.std: 2.5 Relational instructions
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     OpenCLRelational, ExtInstOpenCLStdRoundTripTest,
     ::testing::ValuesIn(std::vector<InstructionCase>({
         CASE3(Bitselect, bitselect), // enum value 186
         CASE3(Select, select), // enum value 187
-    })),);
+    })));
 
 // OpenCL.std: 2.6 Vector data load and store instructions
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     OpenCLVectorLoadStore, ExtInstOpenCLStdRoundTripTest,
     ::testing::ValuesIn(std::vector<InstructionCase>({
         // The last argument to Vloadn must be one of 2, 3, 4, 8, 16.
@@ -306,20 +306,20 @@ INSTANTIATE_TEST_CASE_P(
         CASE3Round(Vstorea_halfn_r, vstorea_halfn_r, RTZ),
         CASE3Round(Vstorea_halfn_r, vstorea_halfn_r, RTP),
         CASE3Round(Vstorea_halfn_r, vstorea_halfn_r, RTN),
-    })),);
+    })));
 
 // OpenCL.std: 2.7 Miscellaneous vector instructions
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     OpenCLMiscellaneousVector, ExtInstOpenCLStdRoundTripTest,
     ::testing::ValuesIn(std::vector<InstructionCase>({
         CASE2(Shuffle, shuffle),
         CASE3(Shuffle2, shuffle2),
-    })),);
+    })));
 
 // OpenCL.std: 2.8 Miscellaneous instructions
 
 #define PREFIX uint32_t(OpenCLLIB::Entrypoints::Printf), "printf"
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     OpenCLMiscPrintf, ExtInstOpenCLStdRoundTripTest,
     ::testing::ValuesIn(std::vector<InstructionCase>({
       // Printf is interesting because it takes a variable number of arguments.
@@ -338,14 +338,14 @@ INSTANTIATE_TEST_CASE_P(
         {4, 5, 6, 7, 8, 9, 10, 11, 12, 13}},
       {PREFIX, "%4 %5 %6 %7 %8 %9 %10 %11 %12 %13 %14",
         {4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14}},
-    })),);
+    })));
 #undef PREFIX
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     OpenCLMiscPrefetch, ExtInstOpenCLStdRoundTripTest,
     ::testing::ValuesIn(std::vector<InstructionCase>({
         CASE2(Prefetch, prefetch),
-    })),);
+    })));
 
 // OpenCL.std: 2.9.1 Image encoding
 // No new instructions defined in this section.

+ 4 - 4
3rdparty/spirv-tools/test/generator_magic_number_test.cpp

@@ -34,7 +34,7 @@ TEST_P(GeneratorMagicNumberTest, Single) {
               GetParam().name());
 }
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     Registered, GeneratorMagicNumberTest,
     ::testing::ValuesIn(std::vector<EnumCase<spv_generator_t>>{
         {SPV_GENERATOR_KHRONOS, "Khronos"},
@@ -47,16 +47,16 @@ INSTANTIATE_TEST_CASE_P(
          "Khronos LLVM/SPIR-V Translator"},
         {SPV_GENERATOR_KHRONOS_ASSEMBLER, "Khronos SPIR-V Tools Assembler"},
         {SPV_GENERATOR_KHRONOS_GLSLANG, "Khronos Glslang Reference Front End"},
-    }), );
+    }));
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     Unregistered, GeneratorMagicNumberTest,
     ::testing::ValuesIn(std::vector<EnumCase<spv_generator_t>>{
         // We read registered entries from the SPIR-V XML Registry file
         // which can change over time.
         {spv_generator_t(1000), "Unknown"},
         {spv_generator_t(9999), "Unknown"},
-    }), );
+    }));
 
 }  // namespace
 }  // namespace spvtools

+ 40 - 40
3rdparty/spirv-tools/test/hex_float_test.cpp

@@ -81,7 +81,7 @@ TEST_P(HexDoubleTest, DecodeCorrectly) {
   EXPECT_THAT(Decode<double>(GetParam().second), Eq(GetParam().first));
 }
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     Float32Tests, HexFloatTest,
     ::testing::ValuesIn(std::vector<std::pair<FloatProxy<float>, std::string>>({
         {0.f, "0x0p+0"},
@@ -131,9 +131,9 @@ INSTANTIATE_TEST_CASE_P(
         {float(ldexp(1.0, -127) / 2.0 + (ldexp(1.0, -127) / 4.0f)),
          "0x1.8p-128"},
 
-    })), );
+    })));
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     Float32NanTests, HexFloatTest,
     ::testing::ValuesIn(std::vector<std::pair<FloatProxy<float>, std::string>>({
         // Various NAN and INF cases
@@ -149,9 +149,9 @@ INSTANTIATE_TEST_CASE_P(
         {uint32_t(0x7f800c00), "0x1.0018p+128"},     // +nan
         {uint32_t(0x7F80F000), "0x1.01ep+128"},      // +nan
         {uint32_t(0x7FFFFFFF), "0x1.fffffep+128"},   // +nan
-    })), );
+    })));
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     Float64Tests, HexDoubleTest,
     ::testing::ValuesIn(
         std::vector<std::pair<FloatProxy<double>, std::string>>({
@@ -222,9 +222,9 @@ INSTANTIATE_TEST_CASE_P(
             {ldexp(1.0, -1023) / 2.0 + (ldexp(1.0, -1023) / 4.0),
              "0x1.8p-1024"},
 
-        })), );
+        })));
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     Float64NanTests, HexDoubleTest,
     ::testing::ValuesIn(std::vector<
                         std::pair<FloatProxy<double>, std::string>>({
@@ -241,7 +241,7 @@ INSTANTIATE_TEST_CASE_P(
         {uint64_t(0x7FF0000000000001LL), "0x1.0000000000001p+1024"},   // -nan
         {uint64_t(0x7FF0000300000000LL), "0x1.00003p+1024"},           // -nan
         {uint64_t(0x7FFFFFFFFFFFFFFFLL), "0x1.fffffffffffffp+1024"},   // -nan
-    })), );
+    })));
 
 // Tests that encoding a value and decoding it again restores
 // the same value.
@@ -263,14 +263,14 @@ TEST_P(RoundTripDoubleTest, CanStoreAccurately) {
   EXPECT_THAT(GetParam(), Eq(res.getAsFloat()));
 }
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     Float32StoreTests, RoundTripFloatTest,
     ::testing::ValuesIn(std::vector<float>(
         {// Value requiring more than 6 digits of precision to be
          // represented accurately.
          3.0000002f})));
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     Float64StoreTests, RoundTripDoubleTest,
     ::testing::ValuesIn(std::vector<double>(
         {// Value requiring more than 15 digits of precision to be
@@ -300,7 +300,7 @@ TEST_P(DecodeHexDoubleTest, DecodeCorrectly) {
   EXPECT_THAT(Decode<double>(GetParam().first), Eq(GetParam().second));
 }
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     Float32DecodeTests, DecodeHexFloatTest,
     ::testing::ValuesIn(std::vector<std::pair<std::string, FloatProxy<float>>>({
         {"0x0p+000", 0.f},
@@ -320,9 +320,9 @@ INSTANTIATE_TEST_CASE_P(
         {"0xFFp+0", 255.f},
         {"0x0.8p+0", 0.5f},
         {"0x0.4p+0", 0.25f},
-    })), );
+    })));
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     Float32DecodeInfTests, DecodeHexFloatTest,
     ::testing::ValuesIn(std::vector<std::pair<std::string, FloatProxy<float>>>({
         // inf cases
@@ -330,9 +330,9 @@ INSTANTIATE_TEST_CASE_P(
         {"0x32p+127", uint32_t(0x7F800000)},   // inf
         {"0x32p+500", uint32_t(0x7F800000)},   // inf
         {"-0x32p+127", uint32_t(0xFF800000)},  // -inf
-    })), );
+    })));
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     Float64DecodeTests, DecodeHexDoubleTest,
     ::testing::ValuesIn(
         std::vector<std::pair<std::string, FloatProxy<double>>>({
@@ -353,9 +353,9 @@ INSTANTIATE_TEST_CASE_P(
             {"0xFFp+0", 255.},
             {"0x0.8p+0", 0.5},
             {"0x0.4p+0", 0.25},
-        })), );
+        })));
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     Float64DecodeInfTests, DecodeHexDoubleTest,
     ::testing::ValuesIn(
         std::vector<std::pair<std::string, FloatProxy<double>>>({
@@ -364,7 +364,7 @@ INSTANTIATE_TEST_CASE_P(
             {"0x32p+1023", uint64_t(0x7FF0000000000000)},   // inf
             {"0x32p+5000", uint64_t(0x7FF0000000000000)},   // inf
             {"-0x32p+1023", uint64_t(0xFFF0000000000000)},  // -inf
-        })), );
+        })));
 
 TEST(FloatProxy, ValidConversion) {
   EXPECT_THAT(FloatProxy<float>(1.f).getAsFloat(), Eq(1.0f));
@@ -503,7 +503,7 @@ TEST_P(FloatProxyDoubleTest, EncodeCorrectly) {
       Eq(GetParam().second));
 }
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     Float32Tests, FloatProxyFloatTest,
     ::testing::ValuesIn(std::vector<std::pair<FloatProxy<float>, std::string>>({
         // Zero
@@ -533,9 +533,9 @@ INSTANTIATE_TEST_CASE_P(
 
         {std::numeric_limits<float>::infinity(), "0x1p+128"},
         {-std::numeric_limits<float>::infinity(), "-0x1p+128"},
-    })), );
+    })));
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     Float64Tests, FloatProxyDoubleTest,
     ::testing::ValuesIn(
         std::vector<std::pair<FloatProxy<double>, std::string>>({
@@ -570,7 +570,7 @@ INSTANTIATE_TEST_CASE_P(
             {std::numeric_limits<double>::infinity(), "0x1p+1024"},
             {-std::numeric_limits<double>::infinity(), "-0x1p+1024"},
 
-        })), );
+        })));
 
 // double is used so that unbiased_exponent can be used with the output
 // of ldexp directly.
@@ -792,7 +792,7 @@ TEST_P(HexFloatRoundTest, RoundDownToFP16) {
 }
 
 // clang-format off
-INSTANTIATE_TEST_CASE_P(F32ToF16, HexFloatRoundTest,
+INSTANTIATE_TEST_SUITE_P(F32ToF16, HexFloatRoundTest,
   ::testing::ValuesIn(std::vector<RoundSignificandCase>(
   {
     {float_fractions({0}), std::make_pair(half_bits_set({}), false), RD::kToZero},
@@ -838,7 +838,7 @@ INSTANTIATE_TEST_CASE_P(F32ToF16, HexFloatRoundTest,
     {static_cast<float>(ldexp(float_fractions({0, 1, 11, 13}), -129)), std::make_pair(half_bits_set({0, 9}), false), RD::kToPositiveInfinity},
     {static_cast<float>(ldexp(float_fractions({0, 1, 11, 13}), -131)), std::make_pair(half_bits_set({0}), false), RD::kToNegativeInfinity},
     {static_cast<float>(ldexp(float_fractions({0, 1, 11, 13}), -130)), std::make_pair(half_bits_set({0, 9}), false), RD::kToNearestEven},
-  })),);
+  })));
 // clang-format on
 
 struct UpCastSignificandCase {
@@ -872,7 +872,7 @@ TEST_P(HexFloatRoundUpSignificandTest, Widening) {
   }
 }
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     F16toF32, HexFloatRoundUpSignificandTest,
     // 0xFC00 of the source 16-bit hex value cover the sign and the exponent.
     // They are ignored for this test.
@@ -881,7 +881,7 @@ INSTANTIATE_TEST_CASE_P(
         {0x0F00, 0x600000},
         {0x0F01, 0x602000},
         {0x0FFF, 0x7FE000},
-    })), );
+    })));
 
 struct DownCastTest {
   float source_float;
@@ -923,7 +923,7 @@ TEST_P(HexFloatFP32To16Tests, NarrowingCasts) {
 const uint16_t positive_infinity = 0x7C00;
 const uint16_t negative_infinity = 0xFC00;
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     F32ToF16, HexFloatFP32To16Tests,
     ::testing::ValuesIn(std::vector<DownCastTest>({
         // Exactly representable as half.
@@ -1014,7 +1014,7 @@ INSTANTIATE_TEST_CASE_P(
           RD::kToNearestEven}},
 
         // Nans are below because we cannot test for equality.
-    })), );
+    })));
 
 struct UpCastCase {
   uint16_t source_half;
@@ -1043,7 +1043,7 @@ TEST_P(HexFloatFP16To32Tests, WideningCasts) {
   }
 }
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     F16ToF32, HexFloatFP16To32Tests,
     ::testing::ValuesIn(std::vector<UpCastCase>({
         {0x0000, 0.f},
@@ -1064,7 +1064,7 @@ INSTANTIATE_TEST_CASE_P(
         // inf
         {0x7C00, std::numeric_limits<float>::infinity()},
         {0xFC00, -std::numeric_limits<float>::infinity()},
-    })), );
+    })));
 
 TEST(HexFloatOperationTests, NanTests) {
   using HF = HexFloat<FloatProxy<float>>;
@@ -1137,7 +1137,7 @@ FloatParseCase<T> GoodFloatParseCase(std::string literal, bool negate_value,
   return FloatParseCase<T>{literal, negate_value, true, proxy_expected_value};
 }
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     FloatParse, ParseNormalFloatTest,
     ::testing::ValuesIn(std::vector<FloatParseCase<float>>{
         // Failing cases due to trivially incorrect syntax.
@@ -1169,7 +1169,7 @@ INSTANTIATE_TEST_CASE_P(
         // We can't have -1e40 and negate_value == true since
         // that represents an original case of "--1e40" which
         // is invalid.
-    }), );
+    }));
 
 using ParseNormalFloat16Test =
     ::testing::TestWithParam<FloatParseCase<Float16>>;
@@ -1188,7 +1188,7 @@ TEST_P(ParseNormalFloat16Test, Samples) {
   }
 }
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     Float16Parse, ParseNormalFloat16Test,
     ::testing::ValuesIn(std::vector<FloatParseCase<Float16>>{
         // Failing cases due to trivially incorrect syntax.
@@ -1212,7 +1212,7 @@ INSTANTIATE_TEST_CASE_P(
         BadFloatParseCase<Float16>("-2.0", true, uint16_t{0}),
         BadFloatParseCase<Float16>("+0.0", true, uint16_t{0}),
         BadFloatParseCase<Float16>("+2.0", true, uint16_t{0}),
-    }), );
+    }));
 
 // A test case for detecting infinities.
 template <typename T>
@@ -1235,7 +1235,7 @@ TEST_P(FloatProxyParseOverflowFloatTest, Sample) {
   }
 }
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     FloatOverflow, FloatProxyParseOverflowFloatTest,
     ::testing::ValuesIn(std::vector<OverflowParseCase<float>>({
         {"0", true, 0.0f},
@@ -1247,7 +1247,7 @@ INSTANTIATE_TEST_CASE_P(
         {"-1e40", false, -FLT_MAX},
         {"1e400", false, FLT_MAX},
         {"-1e400", false, -FLT_MAX},
-    })), );
+    })));
 
 using FloatProxyParseOverflowDoubleTest =
     ::testing::TestWithParam<OverflowParseCase<double>>;
@@ -1262,7 +1262,7 @@ TEST_P(FloatProxyParseOverflowDoubleTest, Sample) {
   }
 }
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     DoubleOverflow, FloatProxyParseOverflowDoubleTest,
     ::testing::ValuesIn(std::vector<OverflowParseCase<double>>({
         {"0", true, 0.0},
@@ -1274,7 +1274,7 @@ INSTANTIATE_TEST_CASE_P(
         {"-1e40", true, -1e40},
         {"1e400", false, DBL_MAX},
         {"-1e400", false, -DBL_MAX},
-    })), );
+    })));
 
 using FloatProxyParseOverflowFloat16Test =
     ::testing::TestWithParam<OverflowParseCase<uint16_t>>;
@@ -1291,7 +1291,7 @@ TEST_P(FloatProxyParseOverflowFloat16Test, Sample) {
   }
 }
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     Float16Overflow, FloatProxyParseOverflowFloat16Test,
     ::testing::ValuesIn(std::vector<OverflowParseCase<uint16_t>>({
         {"0", true, uint16_t{0}},
@@ -1305,7 +1305,7 @@ INSTANTIATE_TEST_CASE_P(
         {"-1e38", false, uint16_t{0xfbff}},
         {"-1e40", false, uint16_t{0xfbff}},
         {"-1e400", false, uint16_t{0xfbff}},
-    })), );
+    })));
 
 TEST(FloatProxy, Max) {
   EXPECT_THAT(FloatProxy<Float16>::max().getAsFloat().get_value(),

+ 78 - 78
3rdparty/spirv-tools/test/name_mapper_test.cpp

@@ -54,31 +54,31 @@ TEST_P(FriendlyNameTest, SingleMapping) {
       << " for id " << GetParam().id;
 }
 
-INSTANTIATE_TEST_CASE_P(ScalarType, FriendlyNameTest,
-                        ::testing::ValuesIn(std::vector<NameIdCase>{
-                            {"%1 = OpTypeVoid", 1, "void"},
-                            {"%1 = OpTypeBool", 1, "bool"},
-                            {"%1 = OpTypeInt 8 0", 1, "uchar"},
-                            {"%1 = OpTypeInt 8 1", 1, "char"},
-                            {"%1 = OpTypeInt 16 0", 1, "ushort"},
-                            {"%1 = OpTypeInt 16 1", 1, "short"},
-                            {"%1 = OpTypeInt 32 0", 1, "uint"},
-                            {"%1 = OpTypeInt 32 1", 1, "int"},
-                            {"%1 = OpTypeInt 64 0", 1, "ulong"},
-                            {"%1 = OpTypeInt 64 1", 1, "long"},
-                            {"%1 = OpTypeInt 1 0", 1, "u1"},
-                            {"%1 = OpTypeInt 1 1", 1, "i1"},
-                            {"%1 = OpTypeInt 33 0", 1, "u33"},
-                            {"%1 = OpTypeInt 33 1", 1, "i33"},
+INSTANTIATE_TEST_SUITE_P(ScalarType, FriendlyNameTest,
+                         ::testing::ValuesIn(std::vector<NameIdCase>{
+                             {"%1 = OpTypeVoid", 1, "void"},
+                             {"%1 = OpTypeBool", 1, "bool"},
+                             {"%1 = OpTypeInt 8 0", 1, "uchar"},
+                             {"%1 = OpTypeInt 8 1", 1, "char"},
+                             {"%1 = OpTypeInt 16 0", 1, "ushort"},
+                             {"%1 = OpTypeInt 16 1", 1, "short"},
+                             {"%1 = OpTypeInt 32 0", 1, "uint"},
+                             {"%1 = OpTypeInt 32 1", 1, "int"},
+                             {"%1 = OpTypeInt 64 0", 1, "ulong"},
+                             {"%1 = OpTypeInt 64 1", 1, "long"},
+                             {"%1 = OpTypeInt 1 0", 1, "u1"},
+                             {"%1 = OpTypeInt 1 1", 1, "i1"},
+                             {"%1 = OpTypeInt 33 0", 1, "u33"},
+                             {"%1 = OpTypeInt 33 1", 1, "i33"},
 
-                            {"%1 = OpTypeFloat 16", 1, "half"},
-                            {"%1 = OpTypeFloat 32", 1, "float"},
-                            {"%1 = OpTypeFloat 64", 1, "double"},
-                            {"%1 = OpTypeFloat 10", 1, "fp10"},
-                            {"%1 = OpTypeFloat 55", 1, "fp55"},
-                        }), );
+                             {"%1 = OpTypeFloat 16", 1, "half"},
+                             {"%1 = OpTypeFloat 32", 1, "float"},
+                             {"%1 = OpTypeFloat 64", 1, "double"},
+                             {"%1 = OpTypeFloat 10", 1, "fp10"},
+                             {"%1 = OpTypeFloat 55", 1, "fp55"},
+                         }));
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     VectorType, FriendlyNameTest,
     ::testing::ValuesIn(std::vector<NameIdCase>{
         {"%1 = OpTypeBool %2 = OpTypeVector %1 1", 2, "v1bool"},
@@ -97,9 +97,9 @@ INSTANTIATE_TEST_CASE_P(
         // OpName overrides the element name.
         {"OpName %1 \"time\" %1 = OpTypeFloat 32 %2 = OpTypeVector %1 2", 2,
          "v2time"},
-    }), );
+    }));
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     MatrixType, FriendlyNameTest,
     ::testing::ValuesIn(std::vector<NameIdCase>{
         {"%1 = OpTypeBool %2 = OpTypeVector %1 2 %3 = OpTypeMatrix %2 2", 3,
@@ -114,9 +114,9 @@ INSTANTIATE_TEST_CASE_P(
         {"OpName %2 \"lat_long\" %1 = OpTypeFloat 32 %2 = OpTypeVector %1 2 %3 "
          "= OpTypeMatrix %2 4",
          3, "mat4lat_long"},
-    }), );
+    }));
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     OpName, FriendlyNameTest,
     ::testing::ValuesIn(std::vector<NameIdCase>{
         {"OpName %1 \"abcdefg\"", 1, "abcdefg"},
@@ -146,38 +146,38 @@ INSTANTIATE_TEST_CASE_P(
         // OpName can override other inferences.  We assume valid instruction
         // ordering, where OpName precedes type definitions.
         {"OpName %1 \"myfloat\" %1 = OpTypeFloat 32", 1, "myfloat"},
-    }), );
+    }));
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     UniquenessHeuristic, FriendlyNameTest,
     ::testing::ValuesIn(std::vector<NameIdCase>{
         {"%1 = OpTypeVoid %2 = OpTypeVoid %3 = OpTypeVoid", 1, "void"},
         {"%1 = OpTypeVoid %2 = OpTypeVoid %3 = OpTypeVoid", 2, "void_0"},
         {"%1 = OpTypeVoid %2 = OpTypeVoid %3 = OpTypeVoid", 3, "void_1"},
-    }), );
+    }));
 
-INSTANTIATE_TEST_CASE_P(Arrays, FriendlyNameTest,
-                        ::testing::ValuesIn(std::vector<NameIdCase>{
-                            {"OpName %2 \"FortyTwo\" %1 = OpTypeFloat 32 "
-                             "%2 = OpConstant %1 42 %3 = OpTypeArray %1 %2",
-                             3, "_arr_float_FortyTwo"},
-                            {"%1 = OpTypeInt 32 0 "
-                             "%2 = OpTypeRuntimeArray %1",
-                             2, "_runtimearr_uint"},
-                        }), );
+INSTANTIATE_TEST_SUITE_P(Arrays, FriendlyNameTest,
+                         ::testing::ValuesIn(std::vector<NameIdCase>{
+                             {"OpName %2 \"FortyTwo\" %1 = OpTypeFloat 32 "
+                              "%2 = OpConstant %1 42 %3 = OpTypeArray %1 %2",
+                              3, "_arr_float_FortyTwo"},
+                             {"%1 = OpTypeInt 32 0 "
+                              "%2 = OpTypeRuntimeArray %1",
+                              2, "_runtimearr_uint"},
+                         }));
 
-INSTANTIATE_TEST_CASE_P(Structs, FriendlyNameTest,
-                        ::testing::ValuesIn(std::vector<NameIdCase>{
-                            {"%1 = OpTypeBool "
-                             "%2 = OpTypeStruct %1 %1 %1",
-                             2, "_struct_2"},
-                            {"%1 = OpTypeBool "
-                             "%2 = OpTypeStruct %1 %1 %1 "
-                             "%3 = OpTypeStruct %2 %2",
-                             3, "_struct_3"},
-                        }), );
+INSTANTIATE_TEST_SUITE_P(Structs, FriendlyNameTest,
+                         ::testing::ValuesIn(std::vector<NameIdCase>{
+                             {"%1 = OpTypeBool "
+                              "%2 = OpTypeStruct %1 %1 %1",
+                              2, "_struct_2"},
+                             {"%1 = OpTypeBool "
+                              "%2 = OpTypeStruct %1 %1 %1 "
+                              "%3 = OpTypeStruct %2 %2",
+                              3, "_struct_3"},
+                         }));
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     Pointer, FriendlyNameTest,
     ::testing::ValuesIn(std::vector<NameIdCase>{
         {"%1 = OpTypeFloat 32 %2 = OpTypePointer Workgroup %1", 2,
@@ -189,22 +189,22 @@ INSTANTIATE_TEST_CASE_P(
         {"%1 = OpTypeBool OpTypeForwardPointer %2 Private %2 = OpTypePointer "
          "Private %1",
          2, "_ptr_Private_bool"},
-    }), );
+    }));
 
-INSTANTIATE_TEST_CASE_P(ExoticTypes, FriendlyNameTest,
-                        ::testing::ValuesIn(std::vector<NameIdCase>{
-                            {"%1 = OpTypeEvent", 1, "Event"},
-                            {"%1 = OpTypeDeviceEvent", 1, "DeviceEvent"},
-                            {"%1 = OpTypeReserveId", 1, "ReserveId"},
-                            {"%1 = OpTypeQueue", 1, "Queue"},
-                            {"%1 = OpTypeOpaque \"hello world!\"", 1,
-                             "Opaque_hello_world_"},
-                            {"%1 = OpTypePipe ReadOnly", 1, "PipeReadOnly"},
-                            {"%1 = OpTypePipe WriteOnly", 1, "PipeWriteOnly"},
-                            {"%1 = OpTypePipe ReadWrite", 1, "PipeReadWrite"},
-                            {"%1 = OpTypePipeStorage", 1, "PipeStorage"},
-                            {"%1 = OpTypeNamedBarrier", 1, "NamedBarrier"},
-                        }), );
+INSTANTIATE_TEST_SUITE_P(ExoticTypes, FriendlyNameTest,
+                         ::testing::ValuesIn(std::vector<NameIdCase>{
+                             {"%1 = OpTypeEvent", 1, "Event"},
+                             {"%1 = OpTypeDeviceEvent", 1, "DeviceEvent"},
+                             {"%1 = OpTypeReserveId", 1, "ReserveId"},
+                             {"%1 = OpTypeQueue", 1, "Queue"},
+                             {"%1 = OpTypeOpaque \"hello world!\"", 1,
+                              "Opaque_hello_world_"},
+                             {"%1 = OpTypePipe ReadOnly", 1, "PipeReadOnly"},
+                             {"%1 = OpTypePipe WriteOnly", 1, "PipeWriteOnly"},
+                             {"%1 = OpTypePipe ReadWrite", 1, "PipeReadWrite"},
+                             {"%1 = OpTypePipeStorage", 1, "PipeStorage"},
+                             {"%1 = OpTypeNamedBarrier", 1, "NamedBarrier"},
+                         }));
 
 // Makes a test case for a BuiltIn variable declaration.
 NameIdCase BuiltInCase(std::string assembly_name, std::string expected) {
@@ -226,7 +226,7 @@ NameIdCase BuiltInGLCase(std::string assembly_name) {
   return BuiltInCase(assembly_name, std::string("gl_") + assembly_name);
 }
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     BuiltIns, FriendlyNameTest,
     ::testing::ValuesIn(std::vector<NameIdCase>{
         BuiltInGLCase("Position"),
@@ -275,15 +275,15 @@ INSTANTIATE_TEST_CASE_P(
         BuiltInCase("SubgroupGtMaskKHR"),
         BuiltInCase("SubgroupLeMaskKHR"),
         BuiltInCase("SubgroupLtMaskKHR"),
-    }), );
+    }));
 
-INSTANTIATE_TEST_CASE_P(DebugNameOverridesBuiltin, FriendlyNameTest,
-                        ::testing::ValuesIn(std::vector<NameIdCase>{
-                            {"OpName %1 \"foo\" OpDecorate %1 BuiltIn WorkDim "
-                             "%1 = OpVariable %2 Input",
-                             1, "foo"}}), );
+INSTANTIATE_TEST_SUITE_P(DebugNameOverridesBuiltin, FriendlyNameTest,
+                         ::testing::ValuesIn(std::vector<NameIdCase>{
+                             {"OpName %1 \"foo\" OpDecorate %1 BuiltIn WorkDim "
+                              "%1 = OpVariable %2 Input",
+                              1, "foo"}}));
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     SimpleIntegralConstants, FriendlyNameTest,
     ::testing::ValuesIn(std::vector<NameIdCase>{
         {"%1 = OpTypeInt 32 0 %2 = OpConstant %1 0", 2, "uint_0"},
@@ -301,9 +301,9 @@ INSTANTIATE_TEST_CASE_P(
         {"%1 = OpTypeInt 33 0 %2 = OpConstant %1 0", 2, "u33_0"},
         {"%1 = OpTypeInt 33 1 %2 = OpConstant %1 10", 2, "i33_10"},
         {"%1 = OpTypeInt 33 1 %2 = OpConstant %1 -19", 2, "i33_n19"},
-    }), );
+    }));
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     SimpleFloatConstants, FriendlyNameTest,
     ::testing::ValuesIn(std::vector<NameIdCase>{
         {"%1 = OpTypeFloat 16\n%2 = OpConstant %1 0x1.ff4p+16", 2,
@@ -334,14 +334,14 @@ INSTANTIATE_TEST_CASE_P(
          "double_0x1p_1024"},  // Inf
         {"%1 = OpTypeFloat 64\n%2 = OpConstant %1 -0x1p+1024", 2,
          "double_n0x1p_1024"},  // -Inf
-    }), );
+    }));
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     BooleanConstants, FriendlyNameTest,
     ::testing::ValuesIn(std::vector<NameIdCase>{
         {"%1 = OpTypeBool\n%2 = OpConstantTrue %1", 2, "true"},
         {"%1 = OpTypeBool\n%2 = OpConstantFalse %1", 2, "false"},
-    }), );
+    }));
 
 }  // namespace
 }  // namespace spvtools

+ 2 - 2
3rdparty/spirv-tools/test/named_id_test.cpp

@@ -65,7 +65,7 @@ TEST_P(IdValidityTest, IdTypes) {
   }
 }
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     ValidAndInvalidIds, IdValidityTest,
     ::testing::ValuesIn(std::vector<IdCheckCase>(
         {{"%1", true},          {"%2abc", true},   {"%3Def", true},
@@ -81,7 +81,7 @@ INSTANTIATE_TEST_CASE_P(
          {"%foo_@_bar", false}, {"%", false},
 
          {"5", false},          {"32", false},     {"foo", false},
-         {"a%bar", false}})), );
+         {"a%bar", false}})));
 
 }  // namespace
 }  // namespace spvtools

+ 2 - 2
3rdparty/spirv-tools/test/opcode_require_capabilities_test.cpp

@@ -42,7 +42,7 @@ TEST_P(OpcodeTableCapabilitiesTest, TableEntryMatchesExpectedCapabilities) {
       ElementsIn(CapabilitySet(entry->numCapabilities, entry->capabilities)));
 }
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     TableRowTest, OpcodeTableCapabilitiesTest,
     // Spot-check a few opcodes.
     ::testing::Values(
@@ -72,7 +72,7 @@ INSTANTIATE_TEST_CASE_P(
                                    CapabilitySet{SpvCapabilityNamedBarrier}},
         ExpectedOpCodeCapabilities{
             SpvOpGetKernelMaxNumSubgroups,
-            CapabilitySet{SpvCapabilitySubgroupDispatch}}), );
+            CapabilitySet{SpvCapabilitySubgroupDispatch}}));
 
 }  // namespace
 }  // namespace spvtools

+ 2 - 2
3rdparty/spirv-tools/test/opcode_table_get_test.cpp

@@ -32,8 +32,8 @@ TEST_P(GetTargetOpcodeTableGetTest, InvalidPointerTable) {
   ASSERT_EQ(SPV_ERROR_INVALID_POINTER, spvOpcodeTableGet(nullptr, GetParam()));
 }
 
-INSTANTIATE_TEST_CASE_P(OpcodeTableGet, GetTargetOpcodeTableGetTest,
-                        ValuesIn(spvtest::AllTargetEnvironments()));
+INSTANTIATE_TEST_SUITE_P(OpcodeTableGet, GetTargetOpcodeTableGetTest,
+                         ValuesIn(spvtest::AllTargetEnvironments()));
 
 }  // namespace
 }  // namespace spvtools

+ 66 - 66
3rdparty/spirv-tools/test/operand_capabilities_test.cpp

@@ -91,7 +91,7 @@ TEST_P(EnumCapabilityTest, Sample) {
   }
 
 // See SPIR-V Section 3.3 Execution Model
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     ExecutionModel, EnumCapabilityTest,
     Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
             ValuesIn(std::vector<EnumCapabilityCase>{
@@ -104,30 +104,30 @@ INSTANTIATE_TEST_CASE_P(
                 CASE1(EXECUTION_MODEL, ExecutionModelFragment, Shader),
                 CASE1(EXECUTION_MODEL, ExecutionModelGLCompute, Shader),
                 CASE1(EXECUTION_MODEL, ExecutionModelKernel, Kernel),
-            })), );
+            })));
 
 // See SPIR-V Section 3.4 Addressing Model
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     AddressingModel, EnumCapabilityTest,
     Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
             ValuesIn(std::vector<EnumCapabilityCase>{
                 CASE0(ADDRESSING_MODEL, AddressingModelLogical),
                 CASE1(ADDRESSING_MODEL, AddressingModelPhysical32, Addresses),
                 CASE1(ADDRESSING_MODEL, AddressingModelPhysical64, Addresses),
-            })), );
+            })));
 
 // See SPIR-V Section 3.5 Memory Model
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     MemoryModel, EnumCapabilityTest,
     Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
             ValuesIn(std::vector<EnumCapabilityCase>{
                 CASE1(MEMORY_MODEL, MemoryModelSimple, Shader),
                 CASE1(MEMORY_MODEL, MemoryModelGLSL450, Shader),
                 CASE1(MEMORY_MODEL, MemoryModelOpenCL, Kernel),
-            })), );
+            })));
 
 // See SPIR-V Section 3.6 Execution Mode
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     ExecutionMode, EnumCapabilityTest,
     Combine(
         Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
@@ -169,9 +169,9 @@ INSTANTIATE_TEST_CASE_P(
             CASE1(EXECUTION_MODE, ExecutionModeOutputTriangleStrip, Geometry),
             CASE1(EXECUTION_MODE, ExecutionModeVecTypeHint, Kernel),
             CASE1(EXECUTION_MODE, ExecutionModeContractionOff, Kernel),
-        })), );
+        })));
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     ExecutionModeV11, EnumCapabilityTest,
     Combine(Values(SPV_ENV_UNIVERSAL_1_1),
             ValuesIn(std::vector<EnumCapabilityCase>{
@@ -180,10 +180,10 @@ INSTANTIATE_TEST_CASE_P(
                 CASE1(EXECUTION_MODE, ExecutionModeSubgroupSize,
                       SubgroupDispatch),
                 CASE1(EXECUTION_MODE, ExecutionModeSubgroupsPerWorkgroup,
-                      SubgroupDispatch)})), );
+                      SubgroupDispatch)})));
 
 // See SPIR-V Section 3.7 Storage Class
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     StorageClass, EnumCapabilityTest,
     Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
             ValuesIn(std::vector<EnumCapabilityCase>{
@@ -199,10 +199,10 @@ INSTANTIATE_TEST_CASE_P(
                 CASE1(STORAGE_CLASS, StorageClassPushConstant, Shader),
                 CASE1(STORAGE_CLASS, StorageClassAtomicCounter, AtomicStorage),
                 CASE0(STORAGE_CLASS, StorageClassImage),
-            })), );
+            })));
 
 // See SPIR-V Section 3.8 Dim
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     Dim, EnumCapabilityTest,
     Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
             ValuesIn(std::vector<EnumCapabilityCase>{
@@ -213,10 +213,10 @@ INSTANTIATE_TEST_CASE_P(
                 CASE2(DIMENSIONALITY, DimRect, SampledRect, ImageRect),
                 CASE2(DIMENSIONALITY, DimBuffer, SampledBuffer, ImageBuffer),
                 CASE1(DIMENSIONALITY, DimSubpassData, InputAttachment),
-            })), );
+            })));
 
 // See SPIR-V Section 3.9 Sampler Addressing Mode
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     SamplerAddressingMode, EnumCapabilityTest,
     Combine(
         Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
@@ -228,19 +228,19 @@ INSTANTIATE_TEST_CASE_P(
             CASE1(SAMPLER_ADDRESSING_MODE, SamplerAddressingModeRepeat, Kernel),
             CASE1(SAMPLER_ADDRESSING_MODE, SamplerAddressingModeRepeatMirrored,
                   Kernel),
-        })), );
+        })));
 
 // See SPIR-V Section 3.10 Sampler Filter Mode
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     SamplerFilterMode, EnumCapabilityTest,
     Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
             ValuesIn(std::vector<EnumCapabilityCase>{
                 CASE1(SAMPLER_FILTER_MODE, SamplerFilterModeNearest, Kernel),
                 CASE1(SAMPLER_FILTER_MODE, SamplerFilterModeLinear, Kernel),
-            })), );
+            })));
 
 // See SPIR-V Section 3.11 Image Format
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     ImageFormat, EnumCapabilityTest,
     Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
             ValuesIn(std::vector<EnumCapabilityCase>{
@@ -286,10 +286,10 @@ INSTANTIATE_TEST_CASE_P(
         CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatR16ui, StorageImageExtendedFormats),
         CASE1(SAMPLER_IMAGE_FORMAT, ImageFormatR8ui, StorageImageExtendedFormats),
                 // clang-format on
-            })), );
+            })));
 
 // See SPIR-V Section 3.12 Image Channel Order
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     ImageChannelOrder, EnumCapabilityTest,
     Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
             ValuesIn(std::vector<EnumCapabilityCase>{
@@ -314,10 +314,10 @@ INSTANTIATE_TEST_CASE_P(
                 CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrdersRGBA, Kernel),
                 CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrdersBGRA, Kernel),
                 CASE1(IMAGE_CHANNEL_ORDER, ImageChannelOrderABGR, Kernel),
-            })), );
+            })));
 
 // See SPIR-V Section 3.13 Image Channel Data Type
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     ImageChannelDataType, EnumCapabilityTest,
     Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
             ValuesIn(std::vector<EnumCapabilityCase>{
@@ -340,10 +340,10 @@ INSTANTIATE_TEST_CASE_P(
                 CASE1(IMAGE_CHANNEL_DATA_TYPE, ImageChannelDataTypeUnormInt24, Kernel),
                 CASE1(IMAGE_CHANNEL_DATA_TYPE, ImageChannelDataTypeUnormInt101010_2, Kernel),
                 // clang-format on
-            })), );
+            })));
 
 // See SPIR-V Section 3.14 Image Operands
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     ImageOperands, EnumCapabilityTest,
     Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
             ValuesIn(std::vector<EnumCapabilityCase>{
@@ -358,10 +358,10 @@ INSTANTIATE_TEST_CASE_P(
                 CASE0(OPTIONAL_IMAGE, ImageOperandsSampleMask),
                 CASE1(OPTIONAL_IMAGE, ImageOperandsMinLodMask, MinLod),
                 // clang-format on
-            })), );
+            })));
 
 // See SPIR-V Section 3.15 FP Fast Math Mode
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     FPFastMathMode, EnumCapabilityTest,
     Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
             ValuesIn(std::vector<EnumCapabilityCase>{
@@ -371,29 +371,29 @@ INSTANTIATE_TEST_CASE_P(
                 CASE1(FP_FAST_MATH_MODE, FPFastMathModeNSZMask, Kernel),
                 CASE1(FP_FAST_MATH_MODE, FPFastMathModeAllowRecipMask, Kernel),
                 CASE1(FP_FAST_MATH_MODE, FPFastMathModeFastMask, Kernel),
-            })), );
+            })));
 
 // See SPIR-V Section 3.17 Linkage Type
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     LinkageType, EnumCapabilityTest,
     Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
             ValuesIn(std::vector<EnumCapabilityCase>{
                 CASE1(LINKAGE_TYPE, LinkageTypeExport, Linkage),
                 CASE1(LINKAGE_TYPE, LinkageTypeImport, Linkage),
-            })), );
+            })));
 
 // See SPIR-V Section 3.18 Access Qualifier
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     AccessQualifier, EnumCapabilityTest,
     Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
             ValuesIn(std::vector<EnumCapabilityCase>{
                 CASE1(ACCESS_QUALIFIER, AccessQualifierReadOnly, Kernel),
                 CASE1(ACCESS_QUALIFIER, AccessQualifierWriteOnly, Kernel),
                 CASE1(ACCESS_QUALIFIER, AccessQualifierReadWrite, Kernel),
-            })), );
+            })));
 
 // See SPIR-V Section 3.19 Function Parameter Attribute
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     FunctionParameterAttribute, EnumCapabilityTest,
     Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
             ValuesIn(std::vector<EnumCapabilityCase>{
@@ -407,10 +407,10 @@ INSTANTIATE_TEST_CASE_P(
                 CASE1(FUNCTION_PARAMETER_ATTRIBUTE, FunctionParameterAttributeNoWrite, Kernel),
                 CASE1(FUNCTION_PARAMETER_ATTRIBUTE, FunctionParameterAttributeNoReadWrite, Kernel),
                 // clang-format on
-            })), );
+            })));
 
 // See SPIR-V Section 3.20 Decoration
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     Decoration, EnumCapabilityTest,
     Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
             ValuesIn(std::vector<EnumCapabilityCase>{
@@ -460,25 +460,25 @@ INSTANTIATE_TEST_CASE_P(
                 CASE1(DECORATION, DecorationInputAttachmentIndex,
                       InputAttachment),
                 CASE1(DECORATION, DecorationAlignment, Kernel),
-            })), );
+            })));
 
 #if 0
 // SpecId has different requirements in v1.0 and v1.1:
-INSTANTIATE_TEST_CASE_P(DecorationSpecIdV10, EnumCapabilityTest,
+INSTANTIATE_TEST_SUITE_P(DecorationSpecIdV10, EnumCapabilityTest,
                         Combine(Values(SPV_ENV_UNIVERSAL_1_0),
                                 ValuesIn(std::vector<EnumCapabilityCase>{CASE1(
-                                    DECORATION, DecorationSpecId, Shader)})), );
+                                    DECORATION, DecorationSpecId, Shader)})));
 #endif
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     DecorationV11, EnumCapabilityTest,
     Combine(Values(SPV_ENV_UNIVERSAL_1_1),
             ValuesIn(std::vector<EnumCapabilityCase>{
                 CASE2(DECORATION, DecorationSpecId, Shader, Kernel),
-                CASE1(DECORATION, DecorationMaxByteOffset, Addresses)})), );
+                CASE1(DECORATION, DecorationMaxByteOffset, Addresses)})));
 
 // See SPIR-V Section 3.21 BuiltIn
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     BuiltIn, EnumCapabilityTest,
     Combine(
         Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
@@ -530,38 +530,38 @@ INSTANTIATE_TEST_CASE_P(
             CASE1(BUILT_IN, BuiltInVertexIndex, Shader),
             CASE1(BUILT_IN, BuiltInInstanceIndex, Shader),
             // clang-format on
-        })), );
+        })));
 
 // See SPIR-V Section 3.22 Selection Control
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     SelectionControl, EnumCapabilityTest,
     Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
             ValuesIn(std::vector<EnumCapabilityCase>{
                 CASE0(SELECTION_CONTROL, SelectionControlMaskNone),
                 CASE0(SELECTION_CONTROL, SelectionControlFlattenMask),
                 CASE0(SELECTION_CONTROL, SelectionControlDontFlattenMask),
-            })), );
+            })));
 
 // See SPIR-V Section 3.23 Loop Control
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     LoopControl, EnumCapabilityTest,
     Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
             ValuesIn(std::vector<EnumCapabilityCase>{
                 CASE0(LOOP_CONTROL, LoopControlMaskNone),
                 CASE0(LOOP_CONTROL, LoopControlUnrollMask),
                 CASE0(LOOP_CONTROL, LoopControlDontUnrollMask),
-            })), );
+            })));
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     LoopControlV11, EnumCapabilityTest,
     Combine(Values(SPV_ENV_UNIVERSAL_1_1),
             ValuesIn(std::vector<EnumCapabilityCase>{
                 CASE0(LOOP_CONTROL, LoopControlDependencyInfiniteMask),
                 CASE0(LOOP_CONTROL, LoopControlDependencyLengthMask),
-            })), );
+            })));
 
 // See SPIR-V Section 3.24 Function Control
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     FunctionControl, EnumCapabilityTest,
     Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
             ValuesIn(std::vector<EnumCapabilityCase>{
@@ -570,10 +570,10 @@ INSTANTIATE_TEST_CASE_P(
                 CASE0(FUNCTION_CONTROL, FunctionControlDontInlineMask),
                 CASE0(FUNCTION_CONTROL, FunctionControlPureMask),
                 CASE0(FUNCTION_CONTROL, FunctionControlConstMask),
-            })), );
+            })));
 
 // See SPIR-V Section 3.25 Memory Semantics <id>
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     MemorySemantics, EnumCapabilityTest,
     Combine(
         Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
@@ -592,10 +592,10 @@ INSTANTIATE_TEST_CASE_P(
             CASE1(MEMORY_SEMANTICS_ID, MemorySemanticsAtomicCounterMemoryMask,
                   AtomicStorage),  // Bug 15234
             CASE0(MEMORY_SEMANTICS_ID, MemorySemanticsImageMemoryMask),
-        })), );
+        })));
 
 // See SPIR-V Section 3.26 Memory Access
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     MemoryAccess, EnumCapabilityTest,
     Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
             ValuesIn(std::vector<EnumCapabilityCase>{
@@ -603,10 +603,10 @@ INSTANTIATE_TEST_CASE_P(
                 CASE0(OPTIONAL_MEMORY_ACCESS, MemoryAccessVolatileMask),
                 CASE0(OPTIONAL_MEMORY_ACCESS, MemoryAccessAlignedMask),
                 CASE0(OPTIONAL_MEMORY_ACCESS, MemoryAccessNontemporalMask),
-            })), );
+            })));
 
 // See SPIR-V Section 3.27 Scope <id>
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     Scope, EnumCapabilityTest,
     Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1,
                    SPV_ENV_UNIVERSAL_1_2, SPV_ENV_UNIVERSAL_1_3),
@@ -617,10 +617,10 @@ INSTANTIATE_TEST_CASE_P(
                 CASE0(SCOPE_ID, ScopeSubgroup),
                 CASE0(SCOPE_ID, ScopeInvocation),
                 CASE1(SCOPE_ID, ScopeQueueFamilyKHR, VulkanMemoryModelKHR),
-            })), );
+            })));
 
 // See SPIR-V Section 3.28 Group Operation
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     GroupOperation, EnumCapabilityTest,
     Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
             ValuesIn(std::vector<EnumCapabilityCase>{
@@ -630,10 +630,10 @@ INSTANTIATE_TEST_CASE_P(
                       GroupNonUniformArithmetic, GroupNonUniformBallot),
                 CASE3(GROUP_OPERATION, GroupOperationExclusiveScan, Kernel,
                       GroupNonUniformArithmetic, GroupNonUniformBallot),
-            })), );
+            })));
 
 // See SPIR-V Section 3.29 Kernel Enqueue Flags
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     KernelEnqueueFlags, EnumCapabilityTest,
     Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
             ValuesIn(std::vector<EnumCapabilityCase>{
@@ -641,20 +641,20 @@ INSTANTIATE_TEST_CASE_P(
                 CASE1(KERNEL_ENQ_FLAGS, KernelEnqueueFlagsWaitKernel, Kernel),
                 CASE1(KERNEL_ENQ_FLAGS, KernelEnqueueFlagsWaitWorkGroup,
                       Kernel),
-            })), );
+            })));
 
 // See SPIR-V Section 3.30 Kernel Profiling Info
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     KernelProfilingInfo, EnumCapabilityTest,
     Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
             ValuesIn(std::vector<EnumCapabilityCase>{
                 CASE0(KERNEL_PROFILING_INFO, KernelProfilingInfoMaskNone),
                 CASE1(KERNEL_PROFILING_INFO, KernelProfilingInfoCmdExecTimeMask,
                       Kernel),
-            })), );
+            })));
 
 // See SPIR-V Section 3.31 Capability
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     CapabilityDependsOn, EnumCapabilityTest,
     Combine(
         Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
@@ -717,16 +717,16 @@ INSTANTIATE_TEST_CASE_P(
             CASE1(CAPABILITY, CapabilityStorageImageWriteWithoutFormat, Shader),
             CASE1(CAPABILITY, CapabilityMultiViewport, Geometry),
             // clang-format on
-        })), );
+        })));
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     CapabilityDependsOnV11, EnumCapabilityTest,
     Combine(Values(SPV_ENV_UNIVERSAL_1_1),
             ValuesIn(std::vector<EnumCapabilityCase>{
                 CASE1(CAPABILITY, CapabilitySubgroupDispatch, DeviceEnqueue),
                 CASE1(CAPABILITY, CapabilityNamedBarrier, Kernel),
                 CASE1(CAPABILITY, CapabilityPipeStorage, Pipes),
-            })), );
+            })));
 
 #undef CASE0
 #undef CASE1

+ 8 - 8
3rdparty/spirv-tools/test/operand_pattern_test.cpp

@@ -84,7 +84,7 @@ TEST_P(MaskExpansionTest, Sample) {
 #define PREFIX1                                                         \
   SPV_OPERAND_TYPE_STORAGE_CLASS, SPV_OPERAND_TYPE_SAMPLER_FILTER_MODE, \
       SPV_OPERAND_TYPE_ID
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     OperandPattern, MaskExpansionTest,
     ::testing::ValuesIn(std::vector<MaskExpansionCase>{
         // No bits means no change.
@@ -111,7 +111,7 @@ INSTANTIATE_TEST_CASE_P(
          SpvMemoryAccessVolatileMask | SpvMemoryAccessAlignedMask,
          {PREFIX1},
          {PREFIX1, SPV_OPERAND_TYPE_LITERAL_INTEGER}},
-    }), );
+    }));
 #undef PREFIX0
 #undef PREFIX1
 
@@ -137,9 +137,9 @@ TEST_P(MatchableOperandExpansionTest, MatchableOperandsDontExpand) {
   }
 }
 
-INSTANTIATE_TEST_CASE_P(MatchableOperandExpansion,
-                        MatchableOperandExpansionTest,
-                        ::testing::ValuesIn(allOperandTypes()), );
+INSTANTIATE_TEST_SUITE_P(MatchableOperandExpansion,
+                         MatchableOperandExpansionTest,
+                         ::testing::ValuesIn(allOperandTypes()));
 
 using VariableOperandExpansionTest =
     ::testing::TestWithParam<spv_operand_type_t>;
@@ -157,9 +157,9 @@ TEST_P(VariableOperandExpansionTest, NonMatchableOperandsExpand) {
   }
 }
 
-INSTANTIATE_TEST_CASE_P(NonMatchableOperandExpansion,
-                        VariableOperandExpansionTest,
-                        ::testing::ValuesIn(allOperandTypes()), );
+INSTANTIATE_TEST_SUITE_P(NonMatchableOperandExpansion,
+                         VariableOperandExpansionTest,
+                         ::testing::ValuesIn(allOperandTypes()));
 
 TEST(AlternatePatternFollowingImmediate, Empty) {
   EXPECT_THAT(spvAlternatePatternFollowingImmediate({}),

+ 4 - 4
3rdparty/spirv-tools/test/operand_test.cpp

@@ -33,10 +33,10 @@ TEST_P(GetTargetTest, InvalidPointerTable) {
   ASSERT_EQ(SPV_ERROR_INVALID_POINTER, spvOperandTableGet(nullptr, GetParam()));
 }
 
-INSTANTIATE_TEST_CASE_P(OperandTableGet, GetTargetTest,
-                        ValuesIn(std::vector<spv_target_env>{
-                            SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1,
-                            SPV_ENV_VULKAN_1_0}), );
+INSTANTIATE_TEST_SUITE_P(OperandTableGet, GetTargetTest,
+                         ValuesIn(std::vector<spv_target_env>{
+                             SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1,
+                             SPV_ENV_VULKAN_1_0}));
 
 TEST(OperandString, AllAreDefinedExceptVariable) {
   // None has no string, so don't test it.

+ 7 - 7
3rdparty/spirv-tools/test/opt/aggressive_dead_code_elim_test.cpp

@@ -4254,7 +4254,7 @@ TEST_P(AggressiveEliminateDeadConstantTest, Custom) {
   SinglePassRunAndMatch<AggressiveDCEPass>(assembly_with_dead_const, false);
 }
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     ScalarTypeConstants, AggressiveEliminateDeadConstantTest,
     ::testing::ValuesIn(std::vector<AggressiveEliminateDeadConstantTestCase>({
         // clang-format off
@@ -4346,7 +4346,7 @@ INSTANTIATE_TEST_CASE_P(
         // clang-format on
     })));
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     VectorTypeConstants, AggressiveEliminateDeadConstantTest,
     ::testing::ValuesIn(std::vector<AggressiveEliminateDeadConstantTestCase>({
         // clang-format off
@@ -4473,7 +4473,7 @@ INSTANTIATE_TEST_CASE_P(
         // clang-format on
     })));
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     StructTypeConstants, AggressiveEliminateDeadConstantTest,
     ::testing::ValuesIn(std::vector<AggressiveEliminateDeadConstantTestCase>({
         // clang-format off
@@ -4644,7 +4644,7 @@ INSTANTIATE_TEST_CASE_P(
         // clang-format on
     })));
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     ScalarTypeSpecConstants, AggressiveEliminateDeadConstantTest,
     ::testing::ValuesIn(std::vector<AggressiveEliminateDeadConstantTestCase>({
         // clang-format off
@@ -4697,7 +4697,7 @@ INSTANTIATE_TEST_CASE_P(
         // clang-format on
     })));
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     VectorTypeSpecConstants, AggressiveEliminateDeadConstantTest,
     ::testing::ValuesIn(std::vector<AggressiveEliminateDeadConstantTestCase>({
         // clang-format off
@@ -4819,7 +4819,7 @@ INSTANTIATE_TEST_CASE_P(
         // clang-format on
     })));
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     SpecConstantOp, AggressiveEliminateDeadConstantTest,
     ::testing::ValuesIn(std::vector<AggressiveEliminateDeadConstantTestCase>({
         // clang-format off
@@ -5001,7 +5001,7 @@ INSTANTIATE_TEST_CASE_P(
         // clang-format on
     })));
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     LongDefUseChain, AggressiveEliminateDeadConstantTest,
     ::testing::ValuesIn(std::vector<AggressiveEliminateDeadConstantTestCase>({
         // clang-format off

+ 139 - 0
3rdparty/spirv-tools/test/opt/block_merge_test.cpp

@@ -741,6 +741,145 @@ OpFunctionEnd
   SinglePassRunAndMatch<BlockMergePass>(text, true);
 }
 
+TEST_F(BlockMergeTest, OpPhiInSuccessor) {
+  // Checks that when merging blocks A and B, the OpPhi at the start of B is
+  // removed and uses of its definition are replaced appropriately.
+  const std::string prefix =
+      R"(OpCapability Shader
+%1 = OpExtInstImport "GLSL.std.450"
+OpMemoryModel Logical GLSL450
+OpEntryPoint Fragment %main "main"
+OpExecutionMode %main OriginUpperLeft
+OpSource ESSL 310
+OpName %main "main"
+OpName %x "x"
+OpName %y "y"
+%void = OpTypeVoid
+%6 = OpTypeFunction %void
+%int = OpTypeInt 32 1
+%_ptr_Function_int = OpTypePointer Function %int
+%int_1 = OpConstant %int 1
+%main = OpFunction %void None %6
+%10 = OpLabel
+%x = OpVariable %_ptr_Function_int Function
+%y = OpVariable %_ptr_Function_int Function
+OpStore %x %int_1
+%11 = OpLoad %int %x
+)";
+
+  const std::string suffix_before =
+      R"(OpBranch %12
+%12 = OpLabel
+%13 = OpPhi %int %11 %10
+OpStore %y %13
+OpReturn
+OpFunctionEnd
+)";
+
+  const std::string suffix_after =
+      R"(OpStore %y %11
+OpReturn
+OpFunctionEnd
+)";
+  SinglePassRunAndCheck<BlockMergePass>(prefix + suffix_before,
+                                        prefix + suffix_after, true, true);
+}
+
+TEST_F(BlockMergeTest, MultipleOpPhisInSuccessor) {
+  // Checks that when merging blocks A and B, the OpPhis at the start of B are
+  // removed and uses of their definitions are replaced appropriately.
+  const std::string prefix =
+      R"(OpCapability Shader
+%1 = OpExtInstImport "GLSL.std.450"
+OpMemoryModel Logical GLSL450
+OpEntryPoint Fragment %main "main"
+OpExecutionMode %main OriginUpperLeft
+OpSource ESSL 310
+OpName %main "main"
+OpName %S "S"
+OpMemberName %S 0 "x"
+OpMemberName %S 1 "f"
+OpName %s "s"
+OpName %g "g"
+OpName %y "y"
+OpName %t "t"
+OpName %z "z"
+%void = OpTypeVoid
+%10 = OpTypeFunction %void
+%int = OpTypeInt 32 1
+%float = OpTypeFloat 32
+%S = OpTypeStruct %int %float
+%_ptr_Function_S = OpTypePointer Function %S
+%int_1 = OpConstant %int 1
+%float_2 = OpConstant %float 2
+%16 = OpConstantComposite %S %int_1 %float_2
+%_ptr_Function_float = OpTypePointer Function %float
+%_ptr_Function_int = OpTypePointer Function %int
+%int_3 = OpConstant %int 3
+%int_0 = OpConstant %int 0
+%main = OpFunction %void None %10
+%21 = OpLabel
+%s = OpVariable %_ptr_Function_S Function
+%g = OpVariable %_ptr_Function_float Function
+%y = OpVariable %_ptr_Function_int Function
+%t = OpVariable %_ptr_Function_S Function
+%z = OpVariable %_ptr_Function_float Function
+OpStore %s %16
+OpStore %g %float_2
+OpStore %y %int_3
+%22 = OpLoad %S %s
+OpStore %t %22
+%23 = OpAccessChain %_ptr_Function_float %s %int_1
+%24 = OpLoad %float %23
+%25 = OpLoad %float %g
+)";
+
+  const std::string suffix_before =
+      R"(OpBranch %26
+%26 = OpLabel
+%27 = OpPhi %float %24 %21
+%28 = OpPhi %float %25 %21
+%29 = OpFAdd %float %27 %28
+%30 = OpAccessChain %_ptr_Function_int %s %int_0
+%31 = OpLoad %int %30
+OpBranch %32
+%32 = OpLabel
+%33 = OpPhi %float %29 %26
+%34 = OpPhi %int %31 %26
+%35 = OpConvertSToF %float %34
+OpBranch %36
+%36 = OpLabel
+%37 = OpPhi %float %35 %32
+%38 = OpFSub %float %33 %37
+%39 = OpLoad %int %y
+OpBranch %40
+%40 = OpLabel
+%41 = OpPhi %float %38 %36
+%42 = OpPhi %int %39 %36
+%43 = OpConvertSToF %float %42
+%44 = OpFAdd %float %41 %43
+OpStore %z %44
+OpReturn
+OpFunctionEnd
+)";
+
+  const std::string suffix_after =
+      R"(%29 = OpFAdd %float %24 %25
+%30 = OpAccessChain %_ptr_Function_int %s %int_0
+%31 = OpLoad %int %30
+%35 = OpConvertSToF %float %31
+%38 = OpFSub %float %29 %35
+%39 = OpLoad %int %y
+%43 = OpConvertSToF %float %39
+%44 = OpFAdd %float %38 %43
+OpStore %z %44
+OpReturn
+OpFunctionEnd
+)";
+  SinglePassRunAndCheck<BlockMergePass>(prefix + suffix_before,
+                                        prefix + suffix_after, true, true);
+}
+
 // TODO(greg-lunarg): Add tests to verify handling of these cases:
 //
 //    More complex control flow

+ 6 - 6
3rdparty/spirv-tools/test/opt/def_use_test.cpp

@@ -206,7 +206,7 @@ TEST_P(ParseDefUseTest, Case) {
 }
 
 // clang-format off
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     TestCase, ParseDefUseTest,
     ::testing::ValuesIn(std::vector<ParseDefUseCase>{
         {"", {{}, {}}},                              // no instruction
@@ -629,7 +629,7 @@ TEST_P(ReplaceUseTest, Case) {
 }
 
 // clang-format off
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     TestCase, ReplaceUseTest,
     ::testing::ValuesIn(std::vector<ReplaceUseCase>{
       { // no use, no replace request
@@ -981,7 +981,7 @@ TEST_P(KillDefTest, Case) {
 }
 
 // clang-format off
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     TestCase, KillDefTest,
     ::testing::ValuesIn(std::vector<KillDefCase>{
       { // no def, no use, no kill
@@ -1343,7 +1343,7 @@ TEST_P(AnalyzeInstDefUseTest, Case) {
 }
 
 // clang-format off
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     TestCase, AnalyzeInstDefUseTest,
     ::testing::ValuesIn(std::vector<AnalyzeInstDefUseTestCase>{
       { // A type declaring instruction.
@@ -1464,7 +1464,7 @@ TEST_P(KillInstTest, Case) {
 }
 
 // clang-format off
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     TestCase, KillInstTest,
     ::testing::ValuesIn(std::vector<KillInstTestCase>{
       // Kill id defining instructions.
@@ -1588,7 +1588,7 @@ TEST_P(GetAnnotationsTest, Case) {
 }
 
 // clang-format off
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     TestCase, GetAnnotationsTest,
     ::testing::ValuesIn(std::vector<GetAnnotationsTestCase>{
       // empty

+ 7 - 7
3rdparty/spirv-tools/test/opt/eliminate_dead_const_test.cpp

@@ -197,7 +197,7 @@ TEST_P(EliminateDeadConstantTest, Custom) {
       assembly_with_dead_const, expected, /*  skip_nop = */ true);
 }
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     ScalarTypeConstants, EliminateDeadConstantTest,
     ::testing::ValuesIn(std::vector<EliminateDeadConstantTestCase>({
         // clang-format off
@@ -265,7 +265,7 @@ INSTANTIATE_TEST_CASE_P(
         // clang-format on
     })));
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     VectorTypeConstants, EliminateDeadConstantTest,
     ::testing::ValuesIn(std::vector<EliminateDeadConstantTestCase>({
         // clang-format off
@@ -358,7 +358,7 @@ INSTANTIATE_TEST_CASE_P(
         // clang-format on
     })));
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     StructTypeConstants, EliminateDeadConstantTest,
     ::testing::ValuesIn(std::vector<EliminateDeadConstantTestCase>({
         // clang-format off
@@ -485,7 +485,7 @@ INSTANTIATE_TEST_CASE_P(
         // clang-format on
     })));
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     ScalarTypeSpecConstants, EliminateDeadConstantTest,
     ::testing::ValuesIn(std::vector<EliminateDeadConstantTestCase>({
         // clang-format off
@@ -522,7 +522,7 @@ INSTANTIATE_TEST_CASE_P(
         // clang-format on
     })));
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     VectorTypeSpecConstants, EliminateDeadConstantTest,
     ::testing::ValuesIn(std::vector<EliminateDeadConstantTestCase>({
         // clang-format off
@@ -617,7 +617,7 @@ INSTANTIATE_TEST_CASE_P(
         // clang-format on
     })));
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     SpecConstantOp, EliminateDeadConstantTest,
     ::testing::ValuesIn(std::vector<EliminateDeadConstantTestCase>({
         // clang-format off
@@ -768,7 +768,7 @@ INSTANTIATE_TEST_CASE_P(
         // clang-format on
     })));
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     LongDefUseChain, EliminateDeadConstantTest,
     ::testing::ValuesIn(std::vector<EliminateDeadConstantTestCase>({
         // clang-format off

+ 152 - 152
3rdparty/spirv-tools/test/opt/flatten_decoration_test.cpp

@@ -81,158 +81,158 @@ TEST_P(FlattenDecorationTest, TransformsDecorations) {
   SinglePassRunAndCheck<FlattenDecorationPass>(before, after, false, true);
 }
 
-INSTANTIATE_TEST_CASE_P(NoUses, FlattenDecorationTest,
-                        ::testing::ValuesIn(std::vector<FlattenDecorationCase>{
-                            // No OpDecorationGroup
-                            {"", ""},
-
-                            // OpDecorationGroup without any uses, and
-                            // no OpName.
-                            {"%group = OpDecorationGroup\n", ""},
-
-                            // OpDecorationGroup without any uses, and
-                            // with OpName targeting it. Proves you must
-                            // remove the names as well.
-                            {"OpName %group \"group\"\n"
-                             "%group = OpDecorationGroup\n",
-                             ""},
-
-                            // OpDecorationGroup with decorations that
-                            // target it, but no uses in OpGroupDecorate
-                            // or OpGroupMemberDecorate instructions.
-                            {"OpDecorate %group Flat\n"
-                             "OpDecorate %group NoPerspective\n"
-                             "%group = OpDecorationGroup\n",
-                             ""},
-                        }), );
-
-INSTANTIATE_TEST_CASE_P(OpGroupDecorate, FlattenDecorationTest,
-                        ::testing::ValuesIn(std::vector<FlattenDecorationCase>{
-                            // One OpGroupDecorate
-                            {"OpName %group \"group\"\n"
-                             "OpDecorate %group Flat\n"
-                             "OpDecorate %group NoPerspective\n"
-                             "%group = OpDecorationGroup\n"
-                             "OpGroupDecorate %group %hue %saturation\n",
-                             "OpDecorate %hue Flat\n"
-                             "OpDecorate %saturation Flat\n"
-                             "OpDecorate %hue NoPerspective\n"
-                             "OpDecorate %saturation NoPerspective\n"},
-                            // Multiple OpGroupDecorate
-                            {"OpName %group \"group\"\n"
-                             "OpDecorate %group Flat\n"
-                             "OpDecorate %group NoPerspective\n"
-                             "%group = OpDecorationGroup\n"
-                             "OpGroupDecorate %group %hue %value\n"
-                             "OpGroupDecorate %group %saturation\n",
-                             "OpDecorate %hue Flat\n"
-                             "OpDecorate %value Flat\n"
-                             "OpDecorate %saturation Flat\n"
-                             "OpDecorate %hue NoPerspective\n"
-                             "OpDecorate %value NoPerspective\n"
-                             "OpDecorate %saturation NoPerspective\n"},
-                            // Two group decorations, interleaved
-                            {"OpName %group0 \"group0\"\n"
-                             "OpName %group1 \"group1\"\n"
-                             "OpDecorate %group0 Flat\n"
-                             "OpDecorate %group1 NoPerspective\n"
-                             "%group0 = OpDecorationGroup\n"
-                             "%group1 = OpDecorationGroup\n"
-                             "OpGroupDecorate %group0 %hue %value\n"
-                             "OpGroupDecorate %group1 %saturation\n",
-                             "OpDecorate %hue Flat\n"
-                             "OpDecorate %value Flat\n"
-                             "OpDecorate %saturation NoPerspective\n"},
-                            // Decoration with operands
-                            {"OpName %group \"group\"\n"
-                             "OpDecorate %group Location 42\n"
-                             "%group = OpDecorationGroup\n"
-                             "OpGroupDecorate %group %hue %saturation\n",
-                             "OpDecorate %hue Location 42\n"
-                             "OpDecorate %saturation Location 42\n"},
-                        }), );
-
-INSTANTIATE_TEST_CASE_P(OpGroupMemberDecorate, FlattenDecorationTest,
-                        ::testing::ValuesIn(std::vector<FlattenDecorationCase>{
-                            // One OpGroupMemberDecorate
-                            {"OpName %group \"group\"\n"
-                             "OpDecorate %group Flat\n"
-                             "OpDecorate %group Offset 16\n"
-                             "%group = OpDecorationGroup\n"
-                             "OpGroupMemberDecorate %group %Point 1\n",
-                             "OpMemberDecorate %Point 1 Flat\n"
-                             "OpMemberDecorate %Point 1 Offset 16\n"},
-                            // Multiple OpGroupMemberDecorate using the same
-                            // decoration group.
-                            {"OpName %group \"group\"\n"
-                             "OpDecorate %group Flat\n"
-                             "OpDecorate %group NoPerspective\n"
-                             "OpDecorate %group Offset 8\n"
-                             "%group = OpDecorationGroup\n"
-                             "OpGroupMemberDecorate %group %Point 2\n"
-                             "OpGroupMemberDecorate %group %Camera 1\n",
-                             "OpMemberDecorate %Point 2 Flat\n"
-                             "OpMemberDecorate %Camera 1 Flat\n"
-                             "OpMemberDecorate %Point 2 NoPerspective\n"
-                             "OpMemberDecorate %Camera 1 NoPerspective\n"
-                             "OpMemberDecorate %Point 2 Offset 8\n"
-                             "OpMemberDecorate %Camera 1 Offset 8\n"},
-                            // Two groups of member decorations, interleaved.
-                            // Decoration is with and without operands.
-                            {"OpName %group0 \"group0\"\n"
-                             "OpName %group1 \"group1\"\n"
-                             "OpDecorate %group0 Flat\n"
-                             "OpDecorate %group0 Offset 8\n"
-                             "OpDecorate %group1 NoPerspective\n"
-                             "OpDecorate %group1 Offset 16\n"
-                             "%group0 = OpDecorationGroup\n"
-                             "%group1 = OpDecorationGroup\n"
-                             "OpGroupMemberDecorate %group0 %Point 0\n"
-                             "OpGroupMemberDecorate %group1 %Point 2\n",
-                             "OpMemberDecorate %Point 0 Flat\n"
-                             "OpMemberDecorate %Point 0 Offset 8\n"
-                             "OpMemberDecorate %Point 2 NoPerspective\n"
-                             "OpMemberDecorate %Point 2 Offset 16\n"},
-                        }), );
-
-INSTANTIATE_TEST_CASE_P(UnrelatedDecorations, FlattenDecorationTest,
-                        ::testing::ValuesIn(std::vector<FlattenDecorationCase>{
-                            // A non-group non-member decoration is untouched.
-                            {"OpDecorate %hue Centroid\n"
-                             "OpDecorate %saturation Flat\n",
-                             "OpDecorate %hue Centroid\n"
-                             "OpDecorate %saturation Flat\n"},
-                            // A non-group member decoration is untouched.
-                            {"OpMemberDecorate %Point 0 Offset 0\n"
-                             "OpMemberDecorate %Point 1 Offset 4\n"
-                             "OpMemberDecorate %Point 1 Flat\n",
-                             "OpMemberDecorate %Point 0 Offset 0\n"
-                             "OpMemberDecorate %Point 1 Offset 4\n"
-                             "OpMemberDecorate %Point 1 Flat\n"},
-                            // A non-group non-member decoration survives any
-                            // replacement of group decorations.
-                            {"OpName %group \"group\"\n"
-                             "OpDecorate %group Flat\n"
-                             "OpDecorate %hue Centroid\n"
-                             "OpDecorate %group NoPerspective\n"
-                             "%group = OpDecorationGroup\n"
-                             "OpGroupDecorate %group %hue %saturation\n",
-                             "OpDecorate %hue Flat\n"
-                             "OpDecorate %saturation Flat\n"
-                             "OpDecorate %hue Centroid\n"
-                             "OpDecorate %hue NoPerspective\n"
-                             "OpDecorate %saturation NoPerspective\n"},
-                            // A non-group member decoration survives any
-                            // replacement of group decorations.
-                            {"OpDecorate %group Offset 0\n"
-                             "OpDecorate %group Flat\n"
-                             "OpMemberDecorate %Point 1 Offset 4\n"
-                             "%group = OpDecorationGroup\n"
-                             "OpGroupMemberDecorate %group %Point 0\n",
-                             "OpMemberDecorate %Point 0 Offset 0\n"
-                             "OpMemberDecorate %Point 0 Flat\n"
-                             "OpMemberDecorate %Point 1 Offset 4\n"},
-                        }), );
+INSTANTIATE_TEST_SUITE_P(NoUses, FlattenDecorationTest,
+                         ::testing::ValuesIn(std::vector<FlattenDecorationCase>{
+                             // No OpDecorationGroup
+                             {"", ""},
+
+                             // OpDecorationGroup without any uses, and
+                             // no OpName.
+                             {"%group = OpDecorationGroup\n", ""},
+
+                             // OpDecorationGroup without any uses, and
+                             // with OpName targeting it. Proves you must
+                             // remove the names as well.
+                             {"OpName %group \"group\"\n"
+                              "%group = OpDecorationGroup\n",
+                              ""},
+
+                             // OpDecorationGroup with decorations that
+                             // target it, but no uses in OpGroupDecorate
+                             // or OpGroupMemberDecorate instructions.
+                             {"OpDecorate %group Flat\n"
+                              "OpDecorate %group NoPerspective\n"
+                              "%group = OpDecorationGroup\n",
+                              ""},
+                         }));
+
+INSTANTIATE_TEST_SUITE_P(OpGroupDecorate, FlattenDecorationTest,
+                         ::testing::ValuesIn(std::vector<FlattenDecorationCase>{
+                             // One OpGroupDecorate
+                             {"OpName %group \"group\"\n"
+                              "OpDecorate %group Flat\n"
+                              "OpDecorate %group NoPerspective\n"
+                              "%group = OpDecorationGroup\n"
+                              "OpGroupDecorate %group %hue %saturation\n",
+                              "OpDecorate %hue Flat\n"
+                              "OpDecorate %saturation Flat\n"
+                              "OpDecorate %hue NoPerspective\n"
+                              "OpDecorate %saturation NoPerspective\n"},
+                             // Multiple OpGroupDecorate
+                             {"OpName %group \"group\"\n"
+                              "OpDecorate %group Flat\n"
+                              "OpDecorate %group NoPerspective\n"
+                              "%group = OpDecorationGroup\n"
+                              "OpGroupDecorate %group %hue %value\n"
+                              "OpGroupDecorate %group %saturation\n",
+                              "OpDecorate %hue Flat\n"
+                              "OpDecorate %value Flat\n"
+                              "OpDecorate %saturation Flat\n"
+                              "OpDecorate %hue NoPerspective\n"
+                              "OpDecorate %value NoPerspective\n"
+                              "OpDecorate %saturation NoPerspective\n"},
+                             // Two group decorations, interleaved
+                             {"OpName %group0 \"group0\"\n"
+                              "OpName %group1 \"group1\"\n"
+                              "OpDecorate %group0 Flat\n"
+                              "OpDecorate %group1 NoPerspective\n"
+                              "%group0 = OpDecorationGroup\n"
+                              "%group1 = OpDecorationGroup\n"
+                              "OpGroupDecorate %group0 %hue %value\n"
+                              "OpGroupDecorate %group1 %saturation\n",
+                              "OpDecorate %hue Flat\n"
+                              "OpDecorate %value Flat\n"
+                              "OpDecorate %saturation NoPerspective\n"},
+                             // Decoration with operands
+                             {"OpName %group \"group\"\n"
+                              "OpDecorate %group Location 42\n"
+                              "%group = OpDecorationGroup\n"
+                              "OpGroupDecorate %group %hue %saturation\n",
+                              "OpDecorate %hue Location 42\n"
+                              "OpDecorate %saturation Location 42\n"},
+                         }));
+
+INSTANTIATE_TEST_SUITE_P(OpGroupMemberDecorate, FlattenDecorationTest,
+                         ::testing::ValuesIn(std::vector<FlattenDecorationCase>{
+                             // One OpGroupMemberDecorate
+                             {"OpName %group \"group\"\n"
+                              "OpDecorate %group Flat\n"
+                              "OpDecorate %group Offset 16\n"
+                              "%group = OpDecorationGroup\n"
+                              "OpGroupMemberDecorate %group %Point 1\n",
+                              "OpMemberDecorate %Point 1 Flat\n"
+                              "OpMemberDecorate %Point 1 Offset 16\n"},
+                             // Multiple OpGroupMemberDecorate using the same
+                             // decoration group.
+                             {"OpName %group \"group\"\n"
+                              "OpDecorate %group Flat\n"
+                              "OpDecorate %group NoPerspective\n"
+                              "OpDecorate %group Offset 8\n"
+                              "%group = OpDecorationGroup\n"
+                              "OpGroupMemberDecorate %group %Point 2\n"
+                              "OpGroupMemberDecorate %group %Camera 1\n",
+                              "OpMemberDecorate %Point 2 Flat\n"
+                              "OpMemberDecorate %Camera 1 Flat\n"
+                              "OpMemberDecorate %Point 2 NoPerspective\n"
+                              "OpMemberDecorate %Camera 1 NoPerspective\n"
+                              "OpMemberDecorate %Point 2 Offset 8\n"
+                              "OpMemberDecorate %Camera 1 Offset 8\n"},
+                             // Two groups of member decorations, interleaved.
+                             // Decoration is with and without operands.
+                             {"OpName %group0 \"group0\"\n"
+                              "OpName %group1 \"group1\"\n"
+                              "OpDecorate %group0 Flat\n"
+                              "OpDecorate %group0 Offset 8\n"
+                              "OpDecorate %group1 NoPerspective\n"
+                              "OpDecorate %group1 Offset 16\n"
+                              "%group0 = OpDecorationGroup\n"
+                              "%group1 = OpDecorationGroup\n"
+                              "OpGroupMemberDecorate %group0 %Point 0\n"
+                              "OpGroupMemberDecorate %group1 %Point 2\n",
+                              "OpMemberDecorate %Point 0 Flat\n"
+                              "OpMemberDecorate %Point 0 Offset 8\n"
+                              "OpMemberDecorate %Point 2 NoPerspective\n"
+                              "OpMemberDecorate %Point 2 Offset 16\n"},
+                         }));
+
+INSTANTIATE_TEST_SUITE_P(UnrelatedDecorations, FlattenDecorationTest,
+                         ::testing::ValuesIn(std::vector<FlattenDecorationCase>{
+                             // A non-group non-member decoration is untouched.
+                             {"OpDecorate %hue Centroid\n"
+                              "OpDecorate %saturation Flat\n",
+                              "OpDecorate %hue Centroid\n"
+                              "OpDecorate %saturation Flat\n"},
+                             // A non-group member decoration is untouched.
+                             {"OpMemberDecorate %Point 0 Offset 0\n"
+                              "OpMemberDecorate %Point 1 Offset 4\n"
+                              "OpMemberDecorate %Point 1 Flat\n",
+                              "OpMemberDecorate %Point 0 Offset 0\n"
+                              "OpMemberDecorate %Point 1 Offset 4\n"
+                              "OpMemberDecorate %Point 1 Flat\n"},
+                             // A non-group non-member decoration survives any
+                             // replacement of group decorations.
+                             {"OpName %group \"group\"\n"
+                              "OpDecorate %group Flat\n"
+                              "OpDecorate %hue Centroid\n"
+                              "OpDecorate %group NoPerspective\n"
+                              "%group = OpDecorationGroup\n"
+                              "OpGroupDecorate %group %hue %saturation\n",
+                              "OpDecorate %hue Flat\n"
+                              "OpDecorate %saturation Flat\n"
+                              "OpDecorate %hue Centroid\n"
+                              "OpDecorate %hue NoPerspective\n"
+                              "OpDecorate %saturation NoPerspective\n"},
+                             // A non-group member decoration survives any
+                             // replacement of group decorations.
+                             {"OpDecorate %group Offset 0\n"
+                              "OpDecorate %group Flat\n"
+                              "OpMemberDecorate %Point 1 Offset 4\n"
+                              "%group = OpDecorationGroup\n"
+                              "OpGroupMemberDecorate %group %Point 0\n",
+                              "OpMemberDecorate %Point 0 Offset 0\n"
+                              "OpMemberDecorate %Point 0 Flat\n"
+                              "OpMemberDecorate %Point 1 Offset 4\n"},
+                         }));
 
 }  // namespace
 }  // namespace opt

+ 8 - 8
3rdparty/spirv-tools/test/opt/fold_spec_const_op_composite_test.cpp

@@ -224,7 +224,7 @@ TEST_P(FoldSpecConstantOpAndCompositePassTest, ParamTestCase) {
 
 // Tests that OpSpecConstantComposite opcodes are replace with
 // OpConstantComposite correctly.
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     Composite, FoldSpecConstantOpAndCompositePassTest,
     ::testing::ValuesIn(std::vector<
                         FoldSpecConstantOpAndCompositePassTestCase>({
@@ -330,7 +330,7 @@ INSTANTIATE_TEST_CASE_P(
     })));
 
 // Tests for operations that resulting in different types.
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     Cast, FoldSpecConstantOpAndCompositePassTest,
     ::testing::ValuesIn(
         std::vector<FoldSpecConstantOpAndCompositePassTestCase>({
@@ -567,7 +567,7 @@ INSTANTIATE_TEST_CASE_P(
 
 // Tests about boolean scalar logical operations and comparison operations with
 // scalar int/uint type.
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     Logical, FoldSpecConstantOpAndCompositePassTest,
     ::testing::ValuesIn(std::vector<
                         FoldSpecConstantOpAndCompositePassTestCase>({
@@ -636,7 +636,7 @@ INSTANTIATE_TEST_CASE_P(
     })));
 
 // Tests about arithmetic operations for scalar int and uint types.
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     ScalarArithmetic, FoldSpecConstantOpAndCompositePassTest,
     ::testing::ValuesIn(std::vector<
                         FoldSpecConstantOpAndCompositePassTestCase>({
@@ -821,7 +821,7 @@ INSTANTIATE_TEST_CASE_P(
     })));
 
 // Tests about arithmetic operations for vector int and uint types.
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     VectorArithmetic, FoldSpecConstantOpAndCompositePassTest,
     ::testing::ValuesIn(std::vector<
                         FoldSpecConstantOpAndCompositePassTestCase>({
@@ -1043,7 +1043,7 @@ INSTANTIATE_TEST_CASE_P(
     })));
 
 // Tests for SpecConstantOp CompositeExtract instruction
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     CompositeExtract, FoldSpecConstantOpAndCompositePassTest,
     ::testing::ValuesIn(std::vector<
                         FoldSpecConstantOpAndCompositePassTestCase>({
@@ -1217,7 +1217,7 @@ INSTANTIATE_TEST_CASE_P(
     })));
 
 // Tests the swizzle operations for spec const vectors.
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     VectorShuffle, FoldSpecConstantOpAndCompositePassTest,
     ::testing::ValuesIn(std::vector<
                         FoldSpecConstantOpAndCompositePassTestCase>({
@@ -1310,7 +1310,7 @@ INSTANTIATE_TEST_CASE_P(
     })));
 
 // Test with long use-def chain.
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     LongDefUseChain, FoldSpecConstantOpAndCompositePassTest,
     ::testing::ValuesIn(std::vector<
                         FoldSpecConstantOpAndCompositePassTestCase>({

+ 42 - 42
3rdparty/spirv-tools/test/opt/fold_test.cpp

@@ -265,7 +265,7 @@ const std::string& HeaderWithNaN() {
 }
 
 // clang-format off
-INSTANTIATE_TEST_CASE_P(TestCase, IntegerInstructionFoldingTest,
+INSTANTIATE_TEST_SUITE_P(TestCase, IntegerInstructionFoldingTest,
                         ::testing::Values(
   // Test case 0: fold 0*n
   InstructionFoldingCase<uint32_t>(
@@ -590,7 +590,7 @@ TEST_P(IntVectorInstructionFoldingTest, Case) {
 }
 
 // clang-format off
-INSTANTIATE_TEST_CASE_P(TestCase, IntVectorInstructionFoldingTest,
+INSTANTIATE_TEST_SUITE_P(TestCase, IntVectorInstructionFoldingTest,
 ::testing::Values(
     // Test case 0: fold 0*n
     InstructionFoldingCase<std::vector<uint32_t>>(
@@ -667,7 +667,7 @@ TEST_P(BooleanInstructionFoldingTest, Case) {
 }
 
 // clang-format off
-INSTANTIATE_TEST_CASE_P(TestCase, BooleanInstructionFoldingTest,
+INSTANTIATE_TEST_SUITE_P(TestCase, BooleanInstructionFoldingTest,
                         ::testing::Values(
   // Test case 0: fold true || n
   InstructionFoldingCase<bool>(
@@ -871,7 +871,7 @@ INSTANTIATE_TEST_CASE_P(TestCase, BooleanInstructionFoldingTest,
       2, true)
 ));
 
-INSTANTIATE_TEST_CASE_P(FClampAndCmpLHS, BooleanInstructionFoldingTest,
+INSTANTIATE_TEST_SUITE_P(FClampAndCmpLHS, BooleanInstructionFoldingTest,
 ::testing::Values(
     // Test case 0: fold 0.0 > clamp(n, 0.0, 1.0)
     InstructionFoldingCase<bool>(
@@ -1051,7 +1051,7 @@ INSTANTIATE_TEST_CASE_P(FClampAndCmpLHS, BooleanInstructionFoldingTest,
         2, false)
 ));
 
-INSTANTIATE_TEST_CASE_P(FClampAndCmpRHS, BooleanInstructionFoldingTest,
+INSTANTIATE_TEST_SUITE_P(FClampAndCmpRHS, BooleanInstructionFoldingTest,
 ::testing::Values(
     // Test case 0: fold clamp(n, 0.0, 1.0) > 1.0
     InstructionFoldingCase<bool>(
@@ -1281,7 +1281,7 @@ TEST_P(FloatInstructionFoldingTest, Case) {
 // specification.
 
 // clang-format off
-INSTANTIATE_TEST_CASE_P(FloatConstantFoldingTest, FloatInstructionFoldingTest,
+INSTANTIATE_TEST_SUITE_P(FloatConstantFoldingTest, FloatInstructionFoldingTest,
 ::testing::Values(
     // Test case 0: Fold 2.0 - 1.0
     InstructionFoldingCase<float>(
@@ -1424,7 +1424,7 @@ TEST_P(DoubleInstructionFoldingTest, Case) {
 }
 
 // clang-format off
-INSTANTIATE_TEST_CASE_P(DoubleConstantFoldingTest, DoubleInstructionFoldingTest,
+INSTANTIATE_TEST_SUITE_P(DoubleConstantFoldingTest, DoubleInstructionFoldingTest,
 ::testing::Values(
     // Test case 0: Fold 2.0 - 1.0
     InstructionFoldingCase<double>(
@@ -1534,7 +1534,7 @@ INSTANTIATE_TEST_CASE_P(DoubleConstantFoldingTest, DoubleInstructionFoldingTest,
 // clang-format on
 
 // clang-format off
-INSTANTIATE_TEST_CASE_P(DoubleOrderedCompareConstantFoldingTest, BooleanInstructionFoldingTest,
+INSTANTIATE_TEST_SUITE_P(DoubleOrderedCompareConstantFoldingTest, BooleanInstructionFoldingTest,
                         ::testing::Values(
   // Test case 0: fold 1.0 == 2.0
   InstructionFoldingCase<bool>(
@@ -1666,7 +1666,7 @@ INSTANTIATE_TEST_CASE_P(DoubleOrderedCompareConstantFoldingTest, BooleanInstruct
       2, true)
 ));
 
-INSTANTIATE_TEST_CASE_P(DoubleUnorderedCompareConstantFoldingTest, BooleanInstructionFoldingTest,
+INSTANTIATE_TEST_SUITE_P(DoubleUnorderedCompareConstantFoldingTest, BooleanInstructionFoldingTest,
                         ::testing::Values(
   // Test case 0: fold 1.0 == 2.0
   InstructionFoldingCase<bool>(
@@ -1798,7 +1798,7 @@ INSTANTIATE_TEST_CASE_P(DoubleUnorderedCompareConstantFoldingTest, BooleanInstru
       2, true)
 ));
 
-INSTANTIATE_TEST_CASE_P(FloatOrderedCompareConstantFoldingTest, BooleanInstructionFoldingTest,
+INSTANTIATE_TEST_SUITE_P(FloatOrderedCompareConstantFoldingTest, BooleanInstructionFoldingTest,
                         ::testing::Values(
   // Test case 0: fold 1.0 == 2.0
   InstructionFoldingCase<bool>(
@@ -1930,7 +1930,7 @@ INSTANTIATE_TEST_CASE_P(FloatOrderedCompareConstantFoldingTest, BooleanInstructi
       2, true)
 ));
 
-INSTANTIATE_TEST_CASE_P(FloatUnorderedCompareConstantFoldingTest, BooleanInstructionFoldingTest,
+INSTANTIATE_TEST_SUITE_P(FloatUnorderedCompareConstantFoldingTest, BooleanInstructionFoldingTest,
                         ::testing::Values(
   // Test case 0: fold 1.0 == 2.0
   InstructionFoldingCase<bool>(
@@ -2062,7 +2062,7 @@ INSTANTIATE_TEST_CASE_P(FloatUnorderedCompareConstantFoldingTest, BooleanInstruc
       2, true)
 ));
 
-INSTANTIATE_TEST_CASE_P(DoubleNaNCompareConstantFoldingTest, BooleanInstructionFoldingTest,
+INSTANTIATE_TEST_SUITE_P(DoubleNaNCompareConstantFoldingTest, BooleanInstructionFoldingTest,
                         ::testing::Values(
   // Test case 0: fold NaN == 0 (ord)
   InstructionFoldingCase<bool>(
@@ -2098,7 +2098,7 @@ INSTANTIATE_TEST_CASE_P(DoubleNaNCompareConstantFoldingTest, BooleanInstructionF
       2, true)
 ));
 
-INSTANTIATE_TEST_CASE_P(FloatNaNCompareConstantFoldingTest, BooleanInstructionFoldingTest,
+INSTANTIATE_TEST_SUITE_P(FloatNaNCompareConstantFoldingTest, BooleanInstructionFoldingTest,
                         ::testing::Values(
   // Test case 0: fold NaN == 0 (ord)
   InstructionFoldingCase<bool>(
@@ -2180,7 +2180,7 @@ TEST_P(IntegerInstructionFoldingTestWithMap, Case) {
   }
 }
 // clang-format off
-INSTANTIATE_TEST_CASE_P(TestCase, IntegerInstructionFoldingTestWithMap,
+INSTANTIATE_TEST_SUITE_P(TestCase, IntegerInstructionFoldingTestWithMap,
   ::testing::Values(
       // Test case 0: fold %3 = 0; %3 * n
       InstructionFoldingCaseWithMap<uint32_t>(
@@ -2230,7 +2230,7 @@ TEST_P(BooleanInstructionFoldingTestWithMap, Case) {
 }
 
 // clang-format off
-INSTANTIATE_TEST_CASE_P(TestCase, BooleanInstructionFoldingTestWithMap,
+INSTANTIATE_TEST_SUITE_P(TestCase, BooleanInstructionFoldingTestWithMap,
   ::testing::Values(
       // Test case 0: fold %3 = true; %3 || n
       InstructionFoldingCaseWithMap<bool>(
@@ -2280,7 +2280,7 @@ TEST_P(GeneralInstructionFoldingTest, Case) {
 }
 
 // clang-format off
-INSTANTIATE_TEST_CASE_P(IntegerArithmeticTestCases, GeneralInstructionFoldingTest,
+INSTANTIATE_TEST_SUITE_P(IntegerArithmeticTestCases, GeneralInstructionFoldingTest,
                         ::testing::Values(
     // Test case 0: Don't fold n * m
     InstructionFoldingCase<uint32_t>(
@@ -2740,7 +2740,7 @@ INSTANTIATE_TEST_CASE_P(IntegerArithmeticTestCases, GeneralInstructionFoldingTes
         2, 3)
 ));
 
-INSTANTIATE_TEST_CASE_P(CompositeExtractFoldingTest, GeneralInstructionFoldingTest,
+INSTANTIATE_TEST_SUITE_P(CompositeExtractFoldingTest, GeneralInstructionFoldingTest,
 ::testing::Values(
     // Test case 0: fold Insert feeding extract
     InstructionFoldingCase<uint32_t>(
@@ -2888,7 +2888,7 @@ INSTANTIATE_TEST_CASE_P(CompositeExtractFoldingTest, GeneralInstructionFoldingTe
         4, INT_7_ID)
 ));
 
-INSTANTIATE_TEST_CASE_P(CompositeConstructFoldingTest, GeneralInstructionFoldingTest,
+INSTANTIATE_TEST_SUITE_P(CompositeConstructFoldingTest, GeneralInstructionFoldingTest,
 ::testing::Values(
     // Test case 0: fold Extracts feeding construct
     InstructionFoldingCase<uint32_t>(
@@ -2951,7 +2951,7 @@ INSTANTIATE_TEST_CASE_P(CompositeConstructFoldingTest, GeneralInstructionFolding
         2, VEC2_0_ID)
 ));
 
-INSTANTIATE_TEST_CASE_P(PhiFoldingTest, GeneralInstructionFoldingTest,
+INSTANTIATE_TEST_SUITE_P(PhiFoldingTest, GeneralInstructionFoldingTest,
 ::testing::Values(
   // Test case 0: Fold phi with the same values for all edges.
   InstructionFoldingCase<uint32_t>(
@@ -2993,7 +2993,7 @@ INSTANTIATE_TEST_CASE_P(PhiFoldingTest, GeneralInstructionFoldingTest,
       2, 0)
 ));
 
-INSTANTIATE_TEST_CASE_P(FloatRedundantFoldingTest, GeneralInstructionFoldingTest,
+INSTANTIATE_TEST_SUITE_P(FloatRedundantFoldingTest, GeneralInstructionFoldingTest,
                         ::testing::Values(
     // Test case 0: Don't fold n + 1.0
     InstructionFoldingCase<uint32_t>(
@@ -3211,7 +3211,7 @@ INSTANTIATE_TEST_CASE_P(FloatRedundantFoldingTest, GeneralInstructionFoldingTest
         2, 0)
 ));
 
-INSTANTIATE_TEST_CASE_P(DoubleRedundantFoldingTest, GeneralInstructionFoldingTest,
+INSTANTIATE_TEST_SUITE_P(DoubleRedundantFoldingTest, GeneralInstructionFoldingTest,
                         ::testing::Values(
     // Test case 0: Don't fold n + 1.0
     InstructionFoldingCase<uint32_t>(
@@ -3371,7 +3371,7 @@ INSTANTIATE_TEST_CASE_P(DoubleRedundantFoldingTest, GeneralInstructionFoldingTes
         2, 4)
 ));
 
-INSTANTIATE_TEST_CASE_P(FloatVectorRedundantFoldingTest, GeneralInstructionFoldingTest,
+INSTANTIATE_TEST_SUITE_P(FloatVectorRedundantFoldingTest, GeneralInstructionFoldingTest,
                         ::testing::Values(
     // Test case 0: Don't fold a * vec4(0.0, 0.0, 0.0, 1.0)
     InstructionFoldingCase<uint32_t>(
@@ -3405,7 +3405,7 @@ INSTANTIATE_TEST_CASE_P(FloatVectorRedundantFoldingTest, GeneralInstructionFoldi
         2, 3)
 ));
 
-INSTANTIATE_TEST_CASE_P(DoubleVectorRedundantFoldingTest, GeneralInstructionFoldingTest,
+INSTANTIATE_TEST_SUITE_P(DoubleVectorRedundantFoldingTest, GeneralInstructionFoldingTest,
                         ::testing::Values(
     // Test case 0: Don't fold a * vec4(0.0, 0.0, 0.0, 1.0)
     InstructionFoldingCase<uint32_t>(
@@ -3439,7 +3439,7 @@ INSTANTIATE_TEST_CASE_P(DoubleVectorRedundantFoldingTest, GeneralInstructionFold
         2, 3)
 ));
 
-INSTANTIATE_TEST_CASE_P(IntegerRedundantFoldingTest, GeneralInstructionFoldingTest,
+INSTANTIATE_TEST_SUITE_P(IntegerRedundantFoldingTest, GeneralInstructionFoldingTest,
                         ::testing::Values(
     // Test case 0: Don't fold n + 1
     InstructionFoldingCase<uint32_t>(
@@ -3523,7 +3523,7 @@ INSTANTIATE_TEST_CASE_P(IntegerRedundantFoldingTest, GeneralInstructionFoldingTe
         2, 3)
 ));
 
-INSTANTIATE_TEST_CASE_P(ClampAndCmpLHS, GeneralInstructionFoldingTest,
+INSTANTIATE_TEST_SUITE_P(ClampAndCmpLHS, GeneralInstructionFoldingTest,
 ::testing::Values(
     // Test case 0: Don't Fold 0.0 < clamp(-1, 1)
     InstructionFoldingCase<uint32_t>(
@@ -3659,7 +3659,7 @@ INSTANTIATE_TEST_CASE_P(ClampAndCmpLHS, GeneralInstructionFoldingTest,
         2, 0)
 ));
 
-INSTANTIATE_TEST_CASE_P(ClampAndCmpRHS, GeneralInstructionFoldingTest,
+INSTANTIATE_TEST_SUITE_P(ClampAndCmpRHS, GeneralInstructionFoldingTest,
 ::testing::Values(
     // Test case 0: Don't Fold clamp(-1, 1) < 0.0
     InstructionFoldingCase<uint32_t>(
@@ -3795,7 +3795,7 @@ INSTANTIATE_TEST_CASE_P(ClampAndCmpRHS, GeneralInstructionFoldingTest,
         2, 0)
 ));
 
-INSTANTIATE_TEST_CASE_P(FToIConstantFoldingTest, IntegerInstructionFoldingTest,
+INSTANTIATE_TEST_SUITE_P(FToIConstantFoldingTest, IntegerInstructionFoldingTest,
                         ::testing::Values(
     // Test case 0: Fold int(3.0)
     InstructionFoldingCase<uint32_t>(
@@ -3815,7 +3815,7 @@ INSTANTIATE_TEST_CASE_P(FToIConstantFoldingTest, IntegerInstructionFoldingTest,
         2, 3)
 ));
 
-INSTANTIATE_TEST_CASE_P(IToFConstantFoldingTest, FloatInstructionFoldingTest,
+INSTANTIATE_TEST_SUITE_P(IToFConstantFoldingTest, FloatInstructionFoldingTest,
                         ::testing::Values(
     // Test case 0: Fold float(3)
     InstructionFoldingCase<float>(
@@ -3870,7 +3870,7 @@ TEST_P(ToNegateFoldingTest, Case) {
 }
 
 // clang-format off
-INSTANTIATE_TEST_CASE_P(FloatRedundantSubFoldingTest, ToNegateFoldingTest,
+INSTANTIATE_TEST_SUITE_P(FloatRedundantSubFoldingTest, ToNegateFoldingTest,
                         ::testing::Values(
     // Test case 0: Don't fold 1.0 - n
     InstructionFoldingCase<uint32_t>(
@@ -3914,7 +3914,7 @@ INSTANTIATE_TEST_CASE_P(FloatRedundantSubFoldingTest, ToNegateFoldingTest,
         2, 3)
 ));
 
-INSTANTIATE_TEST_CASE_P(DoubleRedundantSubFoldingTest, ToNegateFoldingTest,
+INSTANTIATE_TEST_SUITE_P(DoubleRedundantSubFoldingTest, ToNegateFoldingTest,
                         ::testing::Values(
     // Test case 0: Don't fold 1.0 - n
     InstructionFoldingCase<uint32_t>(
@@ -3981,7 +3981,7 @@ TEST_P(MatchingInstructionFoldingTest, Case) {
   }
 }
 
-INSTANTIATE_TEST_CASE_P(RedundantIntegerMatching, MatchingInstructionFoldingTest,
+INSTANTIATE_TEST_SUITE_P(RedundantIntegerMatching, MatchingInstructionFoldingTest,
 ::testing::Values(
     // Test case 0: Fold 0 + n (change sign)
     InstructionFoldingCase<bool>(
@@ -4011,7 +4011,7 @@ INSTANTIATE_TEST_CASE_P(RedundantIntegerMatching, MatchingInstructionFoldingTest
         2, true)
 ));
 
-INSTANTIATE_TEST_CASE_P(MergeNegateTest, MatchingInstructionFoldingTest,
+INSTANTIATE_TEST_SUITE_P(MergeNegateTest, MatchingInstructionFoldingTest,
 ::testing::Values(
   // Test case 0: fold consecutive fnegate
   // -(-x) = x
@@ -4348,7 +4348,7 @@ INSTANTIATE_TEST_CASE_P(MergeNegateTest, MatchingInstructionFoldingTest,
         2, true)
 ));
 
-INSTANTIATE_TEST_CASE_P(ReciprocalFDivTest, MatchingInstructionFoldingTest,
+INSTANTIATE_TEST_SUITE_P(ReciprocalFDivTest, MatchingInstructionFoldingTest,
 ::testing::Values(
   // Test case 0: scalar reicprocal
   // x / 0.5 = x * 2.0
@@ -4429,7 +4429,7 @@ INSTANTIATE_TEST_CASE_P(ReciprocalFDivTest, MatchingInstructionFoldingTest,
     3, false)
 ));
 
-INSTANTIATE_TEST_CASE_P(MergeMulTest, MatchingInstructionFoldingTest,
+INSTANTIATE_TEST_SUITE_P(MergeMulTest, MatchingInstructionFoldingTest,
 ::testing::Values(
   // Test case 0: fold consecutive fmuls
   // (x * 3.0) * 2.0 = x * 6.0
@@ -4845,7 +4845,7 @@ INSTANTIATE_TEST_CASE_P(MergeMulTest, MatchingInstructionFoldingTest,
     5, true)
 ));
 
-INSTANTIATE_TEST_CASE_P(MergeDivTest, MatchingInstructionFoldingTest,
+INSTANTIATE_TEST_SUITE_P(MergeDivTest, MatchingInstructionFoldingTest,
 ::testing::Values(
   // Test case 0: merge consecutive fdiv
   // 4.0 / (2.0 / x) = 2.0 * x
@@ -5091,7 +5091,7 @@ INSTANTIATE_TEST_CASE_P(MergeDivTest, MatchingInstructionFoldingTest,
     5, true)
 ));
 
-INSTANTIATE_TEST_CASE_P(MergeAddTest, MatchingInstructionFoldingTest,
+INSTANTIATE_TEST_SUITE_P(MergeAddTest, MatchingInstructionFoldingTest,
 ::testing::Values(
   // Test case 0: merge add of negate
   // (-x) + 2 = 2 - x
@@ -5299,7 +5299,7 @@ INSTANTIATE_TEST_CASE_P(MergeAddTest, MatchingInstructionFoldingTest,
     4, true)
 ));
 
-INSTANTIATE_TEST_CASE_P(MergeSubTest, MatchingInstructionFoldingTest,
+INSTANTIATE_TEST_SUITE_P(MergeSubTest, MatchingInstructionFoldingTest,
 ::testing::Values(
   // Test case 0: merge sub of negate
   // (-x) - 2 = -2 - x
@@ -5524,7 +5524,7 @@ INSTANTIATE_TEST_CASE_P(MergeSubTest, MatchingInstructionFoldingTest,
     4, true)
 ));
 
-INSTANTIATE_TEST_CASE_P(SelectFoldingTest, MatchingInstructionFoldingTest,
+INSTANTIATE_TEST_SUITE_P(SelectFoldingTest, MatchingInstructionFoldingTest,
 ::testing::Values(
   // Test case 0: Fold select with the same values for both sides
   InstructionFoldingCase<bool>(
@@ -5632,7 +5632,7 @@ INSTANTIATE_TEST_CASE_P(SelectFoldingTest, MatchingInstructionFoldingTest,
       4, true)
 ));
 
-INSTANTIATE_TEST_CASE_P(CompositeExtractMatchingTest, MatchingInstructionFoldingTest,
+INSTANTIATE_TEST_SUITE_P(CompositeExtractMatchingTest, MatchingInstructionFoldingTest,
 ::testing::Values(
     // Test case 0: Extracting from result of consecutive shuffles of differing
     // size.
@@ -5775,7 +5775,7 @@ INSTANTIATE_TEST_CASE_P(CompositeExtractMatchingTest, MatchingInstructionFolding
         4, true)
 ));
 
-INSTANTIATE_TEST_CASE_P(DotProductMatchingTest, MatchingInstructionFoldingTest,
+INSTANTIATE_TEST_SUITE_P(DotProductMatchingTest, MatchingInstructionFoldingTest,
 ::testing::Values(
     // Test case 0: Using OpDot to extract last element.
     InstructionFoldingCase<bool>(
@@ -5891,7 +5891,7 @@ TEST_P(MatchingInstructionWithNoResultFoldingTest, Case) {
   }
 }
 
-INSTANTIATE_TEST_CASE_P(StoreMatchingTest, MatchingInstructionWithNoResultFoldingTest,
+INSTANTIATE_TEST_SUITE_P(StoreMatchingTest, MatchingInstructionWithNoResultFoldingTest,
 ::testing::Values(
     // Test case 0: Remove store of undef.
     InstructionFoldingCase<bool>(
@@ -5920,7 +5920,7 @@ INSTANTIATE_TEST_CASE_P(StoreMatchingTest, MatchingInstructionWithNoResultFoldin
         0 /* OpStore */, false)
 ));
 
-INSTANTIATE_TEST_CASE_P(VectorShuffleMatchingTest, MatchingInstructionWithNoResultFoldingTest,
+INSTANTIATE_TEST_SUITE_P(VectorShuffleMatchingTest, MatchingInstructionWithNoResultFoldingTest,
 ::testing::Values(
     // Test case 0: Basic test 1
     InstructionFoldingCase<bool>(

+ 1 - 1
3rdparty/spirv-tools/test/opt/freeze_spec_const_test.cpp

@@ -47,7 +47,7 @@ TEST_P(FreezeSpecConstantValueTypeTest, PrimaryType) {
 }
 
 // Test each primary type.
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     PrimaryTypeSpecConst, FreezeSpecConstantValueTypeTest,
     ::testing::ValuesIn(std::vector<FreezeSpecConstantValueTypeTestCase>({
         // Type declaration, original spec constant definition, expected frozen

+ 6 - 6
3rdparty/spirv-tools/test/opt/set_spec_const_default_value_test.cpp

@@ -50,7 +50,7 @@ TEST_P(DefaultValuesStringParsingTest, TestCase) {
   }
 }
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     ValidString, DefaultValuesStringParsingTest,
     ::testing::ValuesIn(std::vector<DefaultValuesStringParsingTestCase>{
         // 0. empty map
@@ -93,7 +93,7 @@ INSTANTIATE_TEST_CASE_P(
         {"100:1.5e-13", true, SpecIdToValueStrMap{{100, "1.5e-13"}}},
     }));
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     InvalidString, DefaultValuesStringParsingTest,
     ::testing::ValuesIn(std::vector<DefaultValuesStringParsingTestCase>{
         // 0. missing default value
@@ -148,7 +148,7 @@ TEST_P(SetSpecConstantDefaultValueInStringFormParamTest, TestCase) {
       tc.code, tc.expected, /* skip_nop = */ false, tc.default_values);
 }
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     ValidCases, SetSpecConstantDefaultValueInStringFormParamTest,
     ::testing::ValuesIn(std::vector<
                         SetSpecConstantDefaultValueInStringFormTestCase>{
@@ -445,7 +445,7 @@ INSTANTIATE_TEST_CASE_P(
         },
     }));
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     InvalidCases, SetSpecConstantDefaultValueInStringFormParamTest,
     ::testing::ValuesIn(std::vector<
                         SetSpecConstantDefaultValueInStringFormTestCase>{
@@ -610,7 +610,7 @@ TEST_P(SetSpecConstantDefaultValueInBitPatternFormParamTest, TestCase) {
       tc.code, tc.expected, /* skip_nop = */ false, tc.default_values);
 }
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     ValidCases, SetSpecConstantDefaultValueInBitPatternFormParamTest,
     ::testing::ValuesIn(std::vector<
                         SetSpecConstantDefaultValueInBitPatternFormTestCase>{
@@ -937,7 +937,7 @@ INSTANTIATE_TEST_CASE_P(
         },
     }));
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     InvalidCases, SetSpecConstantDefaultValueInBitPatternFormParamTest,
     ::testing::ValuesIn(std::vector<
                         SetSpecConstantDefaultValueInBitPatternFormTestCase>{

+ 1 - 1
3rdparty/spirv-tools/test/opt/strip_debug_info_test.cpp

@@ -89,7 +89,7 @@ TEST_P(StripDebugInfoTest, Kind) {
 
 // Test each possible non-line debug instruction.
 // clang-format off
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     SingleKindDebugInst, StripDebugInfoTest,
     ::testing::ValuesIn(std::vector<const char*>({
         "OpSourceContinued \"I'm a happy shader! Yay! ;)\"",

+ 8 - 2
3rdparty/spirv-tools/test/opt/unify_const_test.cpp

@@ -354,8 +354,14 @@ TEST_P(UnifyFrontEndConstantParamTest, TestCase) {
   Check(expected_builder, test_builder);
 }
 
-INSTANTIATE_TEST_CASE_P(Case, UnifyFrontEndConstantParamTest,
-                        ::testing::ValuesIn(std::vector<UnifyConstantTestCase>({
+INSTANTIATE_TEST_SUITE_P(
+    Case, UnifyFrontEndConstantParamTest,
+    ::
+        testing::
+            ValuesIn(
+                std::
+                    vector<UnifyConstantTestCase>(
+                        {
                             // clang-format off
         // basic tests for scalar constants
         {

+ 1 - 1
3rdparty/spirv-tools/test/opt/utils_test.cpp

@@ -72,7 +72,7 @@ TEST_P(FindAndReplaceTest, SubstringReplacement) {
       << " expected string: " << GetParam().expected_str;
 }
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     SubstringReplacement, FindAndReplaceTest,
     ::testing::ValuesIn(std::vector<SubstringReplacementTestCase>({
         // orig string, find substring, replace substring, expected string,

+ 2 - 1
3rdparty/spirv-tools/test/reduce/CMakeLists.txt

@@ -13,7 +13,8 @@
 # limitations under the License.
 
 add_spvtools_unittest(TARGET reduce
-        SRCS operand_to_constant_test.cpp
+        SRCS merge_blocks_test.cpp
+        operand_to_constant_test.cpp
         operand_to_undef_test.cpp
         operand_to_dominating_id_test.cpp
         reduce_test_util.cpp

+ 513 - 0
3rdparty/spirv-tools/test/reduce/merge_blocks_test.cpp

@@ -0,0 +1,513 @@
+// Copyright (c) 2019 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "reduce_test_util.h"
+#include "source/opt/build_module.h"
+#include "source/reduce/merge_blocks_reduction_opportunity_finder.h"
+#include "source/reduce/reduction_opportunity.h"
+
+namespace spvtools {
+namespace reduce {
+namespace {
+
+TEST(MergeBlocksReductionPassTest, BasicCheck) {
+  std::string shader = R"(
+               OpCapability Shader
+          %1 = OpExtInstImport "GLSL.std.450"
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Fragment %4 "main"
+               OpExecutionMode %4 OriginUpperLeft
+               OpSource ESSL 310
+               OpName %4 "main"
+               OpName %8 "x"
+          %2 = OpTypeVoid
+          %3 = OpTypeFunction %2
+          %6 = OpTypeInt 32 1
+          %7 = OpTypePointer Function %6
+          %9 = OpConstant %6 1
+         %10 = OpConstant %6 2
+         %11 = OpConstant %6 3
+         %12 = OpConstant %6 4
+          %4 = OpFunction %2 None %3
+          %5 = OpLabel
+          %8 = OpVariable %7 Function
+               OpBranch %13
+         %13 = OpLabel
+               OpStore %8 %9
+               OpBranch %14
+         %14 = OpLabel
+               OpStore %8 %10
+               OpBranch %15
+         %15 = OpLabel
+               OpStore %8 %11
+               OpBranch %16
+         %16 = OpLabel
+               OpStore %8 %12
+               OpBranch %17
+         %17 = OpLabel
+               OpReturn
+               OpFunctionEnd
+  )";
+  const auto env = SPV_ENV_UNIVERSAL_1_3;
+  const auto consumer = nullptr;
+  const auto context =
+      BuildModule(env, consumer, shader, kReduceAssembleOption);
+  const auto ops =
+      MergeBlocksReductionOpportunityFinder().GetAvailableOpportunities(
+          context.get());
+  ASSERT_EQ(5, ops.size());
+
+  // Try order 3, 0, 2, 4, 1
+
+  ASSERT_TRUE(ops[3]->PreconditionHolds());
+  ops[3]->TryToApply();
+
+  std::string after_op_3 = R"(
+               OpCapability Shader
+          %1 = OpExtInstImport "GLSL.std.450"
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Fragment %4 "main"
+               OpExecutionMode %4 OriginUpperLeft
+               OpSource ESSL 310
+               OpName %4 "main"
+               OpName %8 "x"
+          %2 = OpTypeVoid
+          %3 = OpTypeFunction %2
+          %6 = OpTypeInt 32 1
+          %7 = OpTypePointer Function %6
+          %9 = OpConstant %6 1
+         %10 = OpConstant %6 2
+         %11 = OpConstant %6 3
+         %12 = OpConstant %6 4
+          %4 = OpFunction %2 None %3
+          %5 = OpLabel
+          %8 = OpVariable %7 Function
+               OpBranch %13
+         %13 = OpLabel
+               OpStore %8 %9
+               OpBranch %14
+         %14 = OpLabel
+               OpStore %8 %10
+               OpBranch %15
+         %15 = OpLabel
+               OpStore %8 %11
+               OpStore %8 %12
+               OpBranch %17
+         %17 = OpLabel
+               OpReturn
+               OpFunctionEnd
+  )";
+
+  CheckEqual(env, after_op_3, context.get());
+
+  ASSERT_TRUE(ops[0]->PreconditionHolds());
+  ops[0]->TryToApply();
+
+  std::string after_op_0 = R"(
+               OpCapability Shader
+          %1 = OpExtInstImport "GLSL.std.450"
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Fragment %4 "main"
+               OpExecutionMode %4 OriginUpperLeft
+               OpSource ESSL 310
+               OpName %4 "main"
+               OpName %8 "x"
+          %2 = OpTypeVoid
+          %3 = OpTypeFunction %2
+          %6 = OpTypeInt 32 1
+          %7 = OpTypePointer Function %6
+          %9 = OpConstant %6 1
+         %10 = OpConstant %6 2
+         %11 = OpConstant %6 3
+         %12 = OpConstant %6 4
+          %4 = OpFunction %2 None %3
+          %5 = OpLabel
+          %8 = OpVariable %7 Function
+               OpStore %8 %9
+               OpBranch %14
+         %14 = OpLabel
+               OpStore %8 %10
+               OpBranch %15
+         %15 = OpLabel
+               OpStore %8 %11
+               OpStore %8 %12
+               OpBranch %17
+         %17 = OpLabel
+               OpReturn
+               OpFunctionEnd
+  )";
+
+  CheckEqual(env, after_op_0, context.get());
+
+  ASSERT_TRUE(ops[2]->PreconditionHolds());
+  ops[2]->TryToApply();
+
+  std::string after_op_2 = R"(
+               OpCapability Shader
+          %1 = OpExtInstImport "GLSL.std.450"
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Fragment %4 "main"
+               OpExecutionMode %4 OriginUpperLeft
+               OpSource ESSL 310
+               OpName %4 "main"
+               OpName %8 "x"
+          %2 = OpTypeVoid
+          %3 = OpTypeFunction %2
+          %6 = OpTypeInt 32 1
+          %7 = OpTypePointer Function %6
+          %9 = OpConstant %6 1
+         %10 = OpConstant %6 2
+         %11 = OpConstant %6 3
+         %12 = OpConstant %6 4
+          %4 = OpFunction %2 None %3
+          %5 = OpLabel
+          %8 = OpVariable %7 Function
+               OpStore %8 %9
+               OpBranch %14
+         %14 = OpLabel
+               OpStore %8 %10
+               OpStore %8 %11
+               OpStore %8 %12
+               OpBranch %17
+         %17 = OpLabel
+               OpReturn
+               OpFunctionEnd
+  )";
+
+  CheckEqual(env, after_op_2, context.get());
+
+  ASSERT_TRUE(ops[4]->PreconditionHolds());
+  ops[4]->TryToApply();
+
+  std::string after_op_4 = R"(
+               OpCapability Shader
+          %1 = OpExtInstImport "GLSL.std.450"
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Fragment %4 "main"
+               OpExecutionMode %4 OriginUpperLeft
+               OpSource ESSL 310
+               OpName %4 "main"
+               OpName %8 "x"
+          %2 = OpTypeVoid
+          %3 = OpTypeFunction %2
+          %6 = OpTypeInt 32 1
+          %7 = OpTypePointer Function %6
+          %9 = OpConstant %6 1
+         %10 = OpConstant %6 2
+         %11 = OpConstant %6 3
+         %12 = OpConstant %6 4
+          %4 = OpFunction %2 None %3
+          %5 = OpLabel
+          %8 = OpVariable %7 Function
+               OpStore %8 %9
+               OpBranch %14
+         %14 = OpLabel
+               OpStore %8 %10
+               OpStore %8 %11
+               OpStore %8 %12
+               OpReturn
+               OpFunctionEnd
+  )";
+
+  CheckEqual(env, after_op_4, context.get());
+
+  ASSERT_TRUE(ops[1]->PreconditionHolds());
+  ops[1]->TryToApply();
+
+  std::string after_op_1 = R"(
+               OpCapability Shader
+          %1 = OpExtInstImport "GLSL.std.450"
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Fragment %4 "main"
+               OpExecutionMode %4 OriginUpperLeft
+               OpSource ESSL 310
+               OpName %4 "main"
+               OpName %8 "x"
+          %2 = OpTypeVoid
+          %3 = OpTypeFunction %2
+          %6 = OpTypeInt 32 1
+          %7 = OpTypePointer Function %6
+          %9 = OpConstant %6 1
+         %10 = OpConstant %6 2
+         %11 = OpConstant %6 3
+         %12 = OpConstant %6 4
+          %4 = OpFunction %2 None %3
+          %5 = OpLabel
+          %8 = OpVariable %7 Function
+               OpStore %8 %9
+               OpStore %8 %10
+               OpStore %8 %11
+               OpStore %8 %12
+               OpReturn
+               OpFunctionEnd
+  )";
+
+  CheckEqual(env, after_op_1, context.get());
+}
+
+TEST(MergeBlocksReductionPassTest, Loops) {
+  std::string shader = R"(
+               OpCapability Shader
+          %1 = OpExtInstImport "GLSL.std.450"
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Fragment %4 "main"
+               OpExecutionMode %4 OriginUpperLeft
+               OpSource ESSL 310
+               OpName %4 "main"
+               OpName %8 "x"
+               OpName %10 "i"
+               OpName %29 "i"
+          %2 = OpTypeVoid
+          %3 = OpTypeFunction %2
+          %6 = OpTypeInt 32 1
+          %7 = OpTypePointer Function %6
+          %9 = OpConstant %6 1
+         %11 = OpConstant %6 0
+         %18 = OpConstant %6 10
+         %19 = OpTypeBool
+          %4 = OpFunction %2 None %3
+          %5 = OpLabel
+          %8 = OpVariable %7 Function
+         %10 = OpVariable %7 Function
+         %29 = OpVariable %7 Function
+               OpStore %8 %9
+               OpBranch %45
+         %45 = OpLabel
+               OpStore %10 %11
+               OpBranch %12
+         %12 = OpLabel
+               OpLoopMerge %14 %15 None
+               OpBranch %16
+         %16 = OpLabel
+         %17 = OpLoad %6 %10
+               OpBranch %46
+         %46 = OpLabel
+         %20 = OpSLessThan %19 %17 %18
+               OpBranchConditional %20 %13 %14
+         %13 = OpLabel
+         %21 = OpLoad %6 %10
+               OpBranch %47
+         %47 = OpLabel
+         %22 = OpLoad %6 %8
+         %23 = OpIAdd %6 %22 %21
+               OpStore %8 %23
+         %24 = OpLoad %6 %10
+         %25 = OpLoad %6 %8
+         %26 = OpIAdd %6 %25 %24
+               OpStore %8 %26
+               OpBranch %48
+         %48 = OpLabel
+               OpBranch %15
+         %15 = OpLabel
+         %27 = OpLoad %6 %10
+         %28 = OpIAdd %6 %27 %9
+               OpStore %10 %28
+               OpBranch %12
+         %14 = OpLabel
+               OpStore %29 %11
+               OpBranch %49
+         %49 = OpLabel
+               OpBranch %30
+         %30 = OpLabel
+               OpLoopMerge %32 %33 None
+               OpBranch %34
+         %34 = OpLabel
+         %35 = OpLoad %6 %29
+         %36 = OpSLessThan %19 %35 %18
+               OpBranch %50
+         %50 = OpLabel
+               OpBranchConditional %36 %31 %32
+         %31 = OpLabel
+         %37 = OpLoad %6 %29
+         %38 = OpLoad %6 %8
+         %39 = OpIAdd %6 %38 %37
+               OpStore %8 %39
+         %40 = OpLoad %6 %29
+         %41 = OpLoad %6 %8
+         %42 = OpIAdd %6 %41 %40
+               OpStore %8 %42
+               OpBranch %33
+         %33 = OpLabel
+         %43 = OpLoad %6 %29
+         %44 = OpIAdd %6 %43 %9
+               OpBranch %51
+         %51 = OpLabel
+               OpStore %29 %44
+               OpBranch %30
+         %32 = OpLabel
+               OpReturn
+               OpFunctionEnd
+  )";
+  const auto env = SPV_ENV_UNIVERSAL_1_3;
+  const auto consumer = nullptr;
+  const auto context =
+      BuildModule(env, consumer, shader, kReduceAssembleOption);
+  const auto ops =
+      MergeBlocksReductionOpportunityFinder().GetAvailableOpportunities(
+          context.get());
+  ASSERT_EQ(11, ops.size());
+
+  for (auto& ri : ops) {
+    ASSERT_TRUE(ri->PreconditionHolds());
+    ri->TryToApply();
+  }
+
+  std::string after = R"(
+               OpCapability Shader
+          %1 = OpExtInstImport "GLSL.std.450"
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Fragment %4 "main"
+               OpExecutionMode %4 OriginUpperLeft
+               OpSource ESSL 310
+               OpName %4 "main"
+               OpName %8 "x"
+               OpName %10 "i"
+               OpName %29 "i"
+          %2 = OpTypeVoid
+          %3 = OpTypeFunction %2
+          %6 = OpTypeInt 32 1
+          %7 = OpTypePointer Function %6
+          %9 = OpConstant %6 1
+         %11 = OpConstant %6 0
+         %18 = OpConstant %6 10
+         %19 = OpTypeBool
+          %4 = OpFunction %2 None %3
+          %5 = OpLabel
+          %8 = OpVariable %7 Function
+         %10 = OpVariable %7 Function
+         %29 = OpVariable %7 Function
+               OpStore %8 %9
+               OpStore %10 %11
+               OpBranch %12
+         %12 = OpLabel
+         %17 = OpLoad %6 %10
+         %20 = OpSLessThan %19 %17 %18
+               OpLoopMerge %14 %13 None
+               OpBranchConditional %20 %13 %14
+         %13 = OpLabel
+         %21 = OpLoad %6 %10
+         %22 = OpLoad %6 %8
+         %23 = OpIAdd %6 %22 %21
+               OpStore %8 %23
+         %24 = OpLoad %6 %10
+         %25 = OpLoad %6 %8
+         %26 = OpIAdd %6 %25 %24
+               OpStore %8 %26
+         %27 = OpLoad %6 %10
+         %28 = OpIAdd %6 %27 %9
+               OpStore %10 %28
+               OpBranch %12
+         %14 = OpLabel
+               OpStore %29 %11
+               OpBranch %30
+         %30 = OpLabel
+         %35 = OpLoad %6 %29
+         %36 = OpSLessThan %19 %35 %18
+               OpLoopMerge %32 %31 None
+               OpBranchConditional %36 %31 %32
+         %31 = OpLabel
+         %37 = OpLoad %6 %29
+         %38 = OpLoad %6 %8
+         %39 = OpIAdd %6 %38 %37
+               OpStore %8 %39
+         %40 = OpLoad %6 %29
+         %41 = OpLoad %6 %8
+         %42 = OpIAdd %6 %41 %40
+               OpStore %8 %42
+         %43 = OpLoad %6 %29
+         %44 = OpIAdd %6 %43 %9
+               OpStore %29 %44
+               OpBranch %30
+         %32 = OpLabel
+               OpReturn
+               OpFunctionEnd
+  )";
+
+  CheckEqual(env, after, context.get());
+}
+
+TEST(MergeBlocksReductionPassTest, MergeWithOpPhi) {
+  std::string shader = R"(
+               OpCapability Shader
+          %1 = OpExtInstImport "GLSL.std.450"
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Fragment %4 "main"
+               OpExecutionMode %4 OriginUpperLeft
+               OpSource ESSL 310
+               OpName %4 "main"
+               OpName %8 "x"
+               OpName %10 "y"
+          %2 = OpTypeVoid
+          %3 = OpTypeFunction %2
+          %6 = OpTypeInt 32 1
+          %7 = OpTypePointer Function %6
+          %9 = OpConstant %6 1
+          %4 = OpFunction %2 None %3
+          %5 = OpLabel
+          %8 = OpVariable %7 Function
+         %10 = OpVariable %7 Function
+               OpStore %8 %9
+         %11 = OpLoad %6 %8
+               OpBranch %12
+         %12 = OpLabel
+         %13 = OpPhi %6 %11 %5
+               OpStore %10 %13
+               OpReturn
+               OpFunctionEnd
+  )";
+
+  const auto env = SPV_ENV_UNIVERSAL_1_3;
+  const auto consumer = nullptr;
+  const auto context =
+      BuildModule(env, consumer, shader, kReduceAssembleOption);
+  const auto ops =
+      MergeBlocksReductionOpportunityFinder().GetAvailableOpportunities(
+          context.get());
+  ASSERT_EQ(1, ops.size());
+
+  ASSERT_TRUE(ops[0]->PreconditionHolds());
+  ops[0]->TryToApply();
+
+  std::string after = R"(
+               OpCapability Shader
+          %1 = OpExtInstImport "GLSL.std.450"
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Fragment %4 "main"
+               OpExecutionMode %4 OriginUpperLeft
+               OpSource ESSL 310
+               OpName %4 "main"
+               OpName %8 "x"
+               OpName %10 "y"
+          %2 = OpTypeVoid
+          %3 = OpTypeFunction %2
+          %6 = OpTypeInt 32 1
+          %7 = OpTypePointer Function %6
+          %9 = OpConstant %6 1
+          %4 = OpFunction %2 None %3
+          %5 = OpLabel
+          %8 = OpVariable %7 Function
+         %10 = OpVariable %7 Function
+               OpStore %8 %9
+         %11 = OpLoad %6 %8
+               OpStore %10 %11
+               OpReturn
+               OpFunctionEnd
+  )";
+
+  CheckEqual(env, after, context.get());
+}
+
+}  // namespace
+}  // namespace reduce
+}  // namespace spvtools

+ 3 - 3
3rdparty/spirv-tools/test/target_env_test.cpp

@@ -45,8 +45,8 @@ TEST_P(TargetEnvTest, ValidSpirvVersion) {
   ASSERT_THAT(spirv_version, AnyOf(0x10000, 0x10100, 0x10200, 0x10300));
 }
 
-INSTANTIATE_TEST_CASE_P(AllTargetEnvs, TargetEnvTest,
-                        ValuesIn(spvtest::AllTargetEnvironments()));
+INSTANTIATE_TEST_SUITE_P(AllTargetEnvs, TargetEnvTest,
+                         ValuesIn(spvtest::AllTargetEnvironments()));
 
 TEST(GetContextTest, InvalidTargetEnvProducesNull) {
   // Use a value beyond the last valid enum value.
@@ -70,7 +70,7 @@ TEST_P(TargetParseTest, InvalidTargetEnvProducesNull) {
   EXPECT_THAT(env, Eq(GetParam().env));
 }
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     TargetParsing, TargetParseTest,
     ValuesIn(std::vector<ParseCase>{
         {"spv1.0", true, SPV_ENV_UNIVERSAL_1_0},

+ 8 - 8
3rdparty/spirv-tools/test/text_literal_test.cpp

@@ -106,7 +106,7 @@ TEST_P(GoodStringTest, GoodStrings) {
   EXPECT_EQ(std::get<1>(GetParam()), l.str);
 }
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     TextLiteral, GoodStringTest,
     ::testing::ValuesIn(std::vector<std::pair<const char*, const char*>>{
         {R"("-")", "-"},
@@ -121,7 +121,7 @@ INSTANTIATE_TEST_CASE_P(
         {"\"\xE4\xBA\xB2\"", "\xE4\xBA\xB2"},
         {"\"\\\xE4\xBA\xB2\"", "\xE4\xBA\xB2"},
         {"\"this \\\" and this \\\\ and \\\xE4\xBA\xB2\"",
-         "this \" and this \\ and \xE4\xBA\xB2"}}), );
+         "this \" and this \\ and \xE4\xBA\xB2"}}));
 
 TEST(TextLiteral, StringTooLong) {
   spv_literal_t l;
@@ -230,7 +230,7 @@ TextLiteralCase Make_Bad_Unsigned(uint32_t bitwidth, const char* text) {
 }
 
 // clang-format off
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     DecimalIntegers, IntegerTest,
     ::testing::ValuesIn(std::vector<TextLiteralCase>{
         // Check max value and overflow value for 1-bit numbers.
@@ -277,7 +277,7 @@ INSTANTIATE_TEST_CASE_P(
         Make_Ok__Unsigned(64, "18446744073709551615", {0xffffffff, 0xffffffff}),
         Make_Ok__Signed(64, "-9223372036854775808", {0x00000000, 0x80000000}),
 
-    }),);
+    }));
 // clang-format on
 
 using IntegerLeadingMinusTest =
@@ -290,7 +290,7 @@ TEST_P(IntegerLeadingMinusTest, CantHaveLeadingMinusOnUnsigned) {
 }
 
 // clang-format off
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     DecimalAndHexIntegers, IntegerLeadingMinusTest,
     ::testing::ValuesIn(std::vector<TextLiteralCase>{
         // Unsigned numbers never allow a leading minus sign.
@@ -303,10 +303,10 @@ INSTANTIATE_TEST_CASE_P(
         Make_Bad_Unsigned(64, "-0"),
         Make_Bad_Unsigned(64, "-0x0"),
         Make_Bad_Unsigned(64, "-0x1"),
-    }),);
+    }));
 
 // clang-format off
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     HexIntegers, IntegerTest,
     ::testing::ValuesIn(std::vector<TextLiteralCase>{
         // Check 0x and 0X prefices.
@@ -370,7 +370,7 @@ INSTANTIATE_TEST_CASE_P(
         Make_Ok__Signed(64, "0x8000000000000000", {0x00000000, 0x80000000}),
         Make_Ok__Unsigned(64, "0x7fffffffffffffff", {0xffffffff, 0x7fffffff}),
         Make_Ok__Unsigned(64, "0x8000000000000000", {0x00000000, 0x80000000}),
-    }),);
+    }));
 // clang-format on
 
 TEST(OverflowIntegerParse, Decimal) {

+ 20 - 20
3rdparty/spirv-tools/test/text_to_binary.annotation_test.cpp

@@ -61,7 +61,7 @@ TEST_P(OpDecorateSimpleTest, AnySimpleDecoration) {
 }
 
 #define CASE(NAME) SpvDecoration##NAME, #NAME
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     TextToBinaryDecorateSimple, OpDecorateSimpleTest,
     Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
             ValuesIn(std::vector<EnumCase<SpvDecoration>>{
@@ -106,12 +106,12 @@ INSTANTIATE_TEST_CASE_P(
                 {CASE(NoContraction), {}},
                 {CASE(InputAttachmentIndex), {102}},
                 {CASE(Alignment), {16}},
-            })), );
+            })));
 
-INSTANTIATE_TEST_CASE_P(TextToBinaryDecorateSimpleV11, OpDecorateSimpleTest,
-                        Combine(Values(SPV_ENV_UNIVERSAL_1_1),
-                                Values(EnumCase<SpvDecoration>{
-                                    CASE(MaxByteOffset), {128}})), );
+INSTANTIATE_TEST_SUITE_P(TextToBinaryDecorateSimpleV11, OpDecorateSimpleTest,
+                         Combine(Values(SPV_ENV_UNIVERSAL_1_1),
+                                 Values(EnumCase<SpvDecoration>{
+                                     CASE(MaxByteOffset), {128}})));
 #undef CASE
 
 TEST_F(OpDecorateSimpleTest, WrongDecoration) {
@@ -164,7 +164,7 @@ TEST_P(OpDecorateEnumTest, AnyEnumDecoration) {
 // clang-format off
 #define CASE(NAME) \
   { SpvBuiltIn##NAME, #NAME, SpvDecorationBuiltIn, "BuiltIn" }
-INSTANTIATE_TEST_CASE_P(TextToBinaryDecorateBuiltIn, OpDecorateEnumTest,
+INSTANTIATE_TEST_SUITE_P(TextToBinaryDecorateBuiltIn, OpDecorateEnumTest,
                         ::testing::ValuesIn(std::vector<DecorateEnumCase>{
                             CASE(Position),
                             CASE(PointSize),
@@ -209,7 +209,7 @@ INSTANTIATE_TEST_CASE_P(TextToBinaryDecorateBuiltIn, OpDecorateEnumTest,
                             CASE(SubgroupLocalInvocationId),
                             CASE(VertexIndex),
                             CASE(InstanceIndex),
-                        }),);
+                        }));
 #undef CASE
 // clang-format on
 
@@ -222,7 +222,7 @@ TEST_F(OpDecorateEnumTest, WrongBuiltIn) {
 // clang-format off
 #define CASE(NAME) \
   { SpvFunctionParameterAttribute##NAME, #NAME, SpvDecorationFuncParamAttr, "FuncParamAttr" }
-INSTANTIATE_TEST_CASE_P(TextToBinaryDecorateFuncParamAttr, OpDecorateEnumTest,
+INSTANTIATE_TEST_SUITE_P(TextToBinaryDecorateFuncParamAttr, OpDecorateEnumTest,
                         ::testing::ValuesIn(std::vector<DecorateEnumCase>{
                             CASE(Zext),
                             CASE(Sext),
@@ -232,7 +232,7 @@ INSTANTIATE_TEST_CASE_P(TextToBinaryDecorateFuncParamAttr, OpDecorateEnumTest,
                             CASE(NoCapture),
                             CASE(NoWrite),
                             CASE(NoReadWrite),
-                      }),);
+                      }));
 #undef CASE
 // clang-format on
 
@@ -245,13 +245,13 @@ TEST_F(OpDecorateEnumTest, WrongFuncParamAttr) {
 // clang-format off
 #define CASE(NAME) \
   { SpvFPRoundingMode##NAME, #NAME, SpvDecorationFPRoundingMode, "FPRoundingMode" }
-INSTANTIATE_TEST_CASE_P(TextToBinaryDecorateFPRoundingMode, OpDecorateEnumTest,
+INSTANTIATE_TEST_SUITE_P(TextToBinaryDecorateFPRoundingMode, OpDecorateEnumTest,
                         ::testing::ValuesIn(std::vector<DecorateEnumCase>{
                             CASE(RTE),
                             CASE(RTZ),
                             CASE(RTP),
                             CASE(RTN),
-                      }),);
+                      }));
 #undef CASE
 // clang-format on
 
@@ -268,7 +268,7 @@ TEST_F(OpDecorateEnumTest, WrongFPRoundingMode) {
 // clang-format off
 #define CASE(ENUM,NAME) \
   { SpvFPFastMathMode##ENUM, #NAME, SpvDecorationFPFastMathMode, "FPFastMathMode" }
-INSTANTIATE_TEST_CASE_P(TextToBinaryDecorateFPFastMathMode, OpDecorateEnumTest,
+INSTANTIATE_TEST_SUITE_P(TextToBinaryDecorateFPFastMathMode, OpDecorateEnumTest,
                         ::testing::ValuesIn(std::vector<DecorateEnumCase>{
                             CASE(MaskNone, None),
                             CASE(NotNaNMask, NotNaN),
@@ -276,7 +276,7 @@ INSTANTIATE_TEST_CASE_P(TextToBinaryDecorateFPFastMathMode, OpDecorateEnumTest,
                             CASE(NSZMask, NSZ),
                             CASE(AllowRecipMask, AllowRecip),
                             CASE(FastMask, Fast),
-                      }),);
+                      }));
 #undef CASE
 // clang-format on
 
@@ -329,13 +329,13 @@ TEST_P(OpDecorateLinkageTest, AnyLinkageDecoration) {
 
 // clang-format off
 #define CASE(ENUM) SpvLinkageType##ENUM, #ENUM
-INSTANTIATE_TEST_CASE_P(TextToBinaryDecorateLinkage, OpDecorateLinkageTest,
+INSTANTIATE_TEST_SUITE_P(TextToBinaryDecorateLinkage, OpDecorateLinkageTest,
                         ::testing::ValuesIn(std::vector<DecorateLinkageCase>{
                             { CASE(Import), "a" },
                             { CASE(Export), "foo" },
                             { CASE(Import), "some kind of long name with spaces etc." },
                             // TODO(dneto): utf-8, escaping, quoting cases.
-                      }),);
+                      }));
 #undef CASE
 // clang-format on
 
@@ -423,7 +423,7 @@ TEST_P(OpMemberDecorateSimpleTest, AnySimpleDecoration) {
 }
 
 #define CASE(NAME) SpvDecoration##NAME, #NAME
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     TextToBinaryDecorateSimple, OpMemberDecorateSimpleTest,
     Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
             ValuesIn(std::vector<EnumCase<SpvDecoration>>{
@@ -468,12 +468,12 @@ INSTANTIATE_TEST_CASE_P(
                 {CASE(NoContraction), {}},
                 {CASE(InputAttachmentIndex), {102}},
                 {CASE(Alignment), {16}},
-            })), );
+            })));
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     TextToBinaryDecorateSimpleV11, OpMemberDecorateSimpleTest,
     Combine(Values(SPV_ENV_UNIVERSAL_1_1),
-            Values(EnumCase<SpvDecoration>{CASE(MaxByteOffset), {128}})), );
+            Values(EnumCase<SpvDecoration>{CASE(MaxByteOffset), {128}})));
 #undef CASE
 
 TEST_F(OpMemberDecorateSimpleTest, WrongDecoration) {

+ 30 - 30
3rdparty/spirv-tools/test/text_to_binary.constant_test.cpp

@@ -47,7 +47,7 @@ TEST_P(SamplerAddressingModeTest, AnySamplerAddressingMode) {
 
 // clang-format off
 #define CASE(NAME) { SpvSamplerAddressingMode##NAME, #NAME }
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     TextToBinarySamplerAddressingMode, SamplerAddressingModeTest,
     ::testing::ValuesIn(std::vector<EnumCase<SpvSamplerAddressingMode>>{
         CASE(None),
@@ -55,7 +55,7 @@ INSTANTIATE_TEST_CASE_P(
         CASE(Clamp),
         CASE(Repeat),
         CASE(RepeatMirrored),
-    }),);
+    }));
 #undef CASE
 // clang-format on
 
@@ -79,12 +79,12 @@ TEST_P(SamplerFilterModeTest, AnySamplerFilterMode) {
 
 // clang-format off
 #define CASE(NAME) { SpvSamplerFilterMode##NAME, #NAME}
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     TextToBinarySamplerFilterMode, SamplerFilterModeTest,
     ::testing::ValuesIn(std::vector<EnumCase<SpvSamplerFilterMode>>{
         CASE(Nearest),
         CASE(Linear),
-    }),);
+    }));
 #undef CASE
 // clang-format on
 
@@ -114,7 +114,7 @@ TEST_P(OpConstantValidTest, ValidTypes) {
 }
 
 // clang-format off
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     TextToBinaryOpConstantValid, OpConstantValidTest,
     ::testing::ValuesIn(std::vector<ConstantTestCase>{
       // Check 16 bits
@@ -232,7 +232,7 @@ INSTANTIATE_TEST_CASE_P(
       {"OpTypeInt 64 1", "0x7fffffff",
         Concatenate({MakeInstruction(SpvOpTypeInt, {1, 64, 1}),
          MakeInstruction(SpvOpConstant, {1, 2, 0x7fffffffu, 0})})},
-    }),);
+    }));
 // clang-format on
 
 // A test case for checking OpConstant with invalid literals with a leading
@@ -255,7 +255,7 @@ TEST_P(OpConstantInvalidLeadingMinusTest, InvalidCase) {
 }
 
 // clang-format off
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     TextToBinaryOpConstantInvalidLeadingMinus, OpConstantInvalidLeadingMinusTest,
     ::testing::ValuesIn(std::vector<InvalidLeadingMinusCase>{
       {"OpTypeInt 16 0", "-0"},
@@ -267,7 +267,7 @@ INSTANTIATE_TEST_CASE_P(
       {"OpTypeInt 64 0", "-0"},
       {"OpTypeInt 64 0", "-0x0"},
       {"OpTypeInt 64 0", "-1"},
-    }),);
+    }));
 // clang-format on
 
 // A test case for invalid floating point literals.
@@ -293,7 +293,7 @@ TEST_P(OpConstantInvalidFloatConstant, Samples) {
 }
 
 // clang-format off
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     TextToBinaryInvalidFloatConstant, OpConstantInvalidFloatConstant,
     ::testing::ValuesIn(std::vector<InvalidFloatConstantCase>{
         {16, "abc"},
@@ -323,7 +323,7 @@ INSTANTIATE_TEST_CASE_P(
         {64, "++1"},
         {32, "1e400"}, // Overflow is an error for 64-bit floats.
         {32, "-1e400"},
-    }),);
+    }));
 // clang-format on
 
 using OpConstantInvalidTypeTest =
@@ -339,7 +339,7 @@ TEST_P(OpConstantInvalidTypeTest, InvalidTypes) {
 }
 
 // clang-format off
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     TextToBinaryOpConstantInvalidValidType, OpConstantInvalidTypeTest,
     ::testing::ValuesIn(std::vector<std::string>{
       {"OpTypeVoid",
@@ -364,7 +364,7 @@ INSTANTIATE_TEST_CASE_P(
         // At least one thing that isn't a type at all
        "OpNot %a %b"
       },
-    }),);
+    }));
 // clang-format on
 
 using OpSpecConstantValidTest =
@@ -381,7 +381,7 @@ TEST_P(OpSpecConstantValidTest, ValidTypes) {
 }
 
 // clang-format off
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     TextToBinaryOpSpecConstantValid, OpSpecConstantValidTest,
     ::testing::ValuesIn(std::vector<ConstantTestCase>{
       // Check 16 bits
@@ -433,7 +433,7 @@ INSTANTIATE_TEST_CASE_P(
       {"OpTypeInt 64 1", "-42",
         Concatenate({MakeInstruction(SpvOpTypeInt, {1, 64, 1}),
          MakeInstruction(SpvOpSpecConstant, {1, 2, uint32_t(-42), uint32_t(-1)})})},
-    }),);
+    }));
 // clang-format on
 
 using OpSpecConstantInvalidTypeTest =
@@ -449,7 +449,7 @@ TEST_P(OpSpecConstantInvalidTypeTest, InvalidTypes) {
 }
 
 // clang-format off
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     TextToBinaryOpSpecConstantInvalidValidType, OpSpecConstantInvalidTypeTest,
     ::testing::ValuesIn(std::vector<std::string>{
       {"OpTypeVoid",
@@ -474,14 +474,14 @@ INSTANTIATE_TEST_CASE_P(
         // At least one thing that isn't a type at all
        "OpNot %a %b"
       },
-    }),);
+    }));
 // clang-format on
 
 const int64_t kMaxUnsigned48Bit = (int64_t(1) << 48) - 1;
 const int64_t kMaxSigned48Bit = (int64_t(1) << 47) - 1;
 const int64_t kMinSigned48Bit = -kMaxSigned48Bit - 1;
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     OpConstantRoundTrip, RoundTripTest,
     ::testing::ValuesIn(std::vector<std::string>{
         // 16 bit
@@ -522,9 +522,9 @@ INSTANTIATE_TEST_CASE_P(
         "%1 = OpTypeFloat 64\n%2 = OpConstant %1 0\n",
         "%1 = OpTypeFloat 64\n%2 = OpConstant %1 1.79767e+308\n",
         "%1 = OpTypeFloat 64\n%2 = OpConstant %1 -1.79767e+308\n",
-    }), );
+    }));
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     OpConstantHalfRoundTrip, RoundTripTest,
     ::testing::ValuesIn(std::vector<std::string>{
         "%1 = OpTypeFloat 16\n%2 = OpConstant %1 -0x0p+0\n",
@@ -557,11 +557,11 @@ INSTANTIATE_TEST_CASE_P(
         "%1 = OpTypeFloat 16\n%2 = OpConstant %1 -0x1.ffp+16\n",   // -nan
         "%1 = OpTypeFloat 16\n%2 = OpConstant %1 -0x1.ffcp+16\n",  // -nan
         "%1 = OpTypeFloat 16\n%2 = OpConstant %1 -0x1.004p+16\n",  // -nan
-    }), );
+    }));
 
 // clang-format off
 // (Clang-format really wants to break up these strings across lines.
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     OpConstantRoundTripNonFinite, RoundTripTest,
     ::testing::ValuesIn(std::vector<std::string>{
   "%1 = OpTypeFloat 32\n%2 = OpConstant %1 -0x1p+128\n",         // -inf
@@ -588,10 +588,10 @@ INSTANTIATE_TEST_CASE_P(
   "%1 = OpTypeFloat 64\n%2 = OpConstant %1 0x1.0000000000001p+1024\n",   // -nan
   "%1 = OpTypeFloat 64\n%2 = OpConstant %1 0x1.00003p+1024\n",           // -nan
   "%1 = OpTypeFloat 64\n%2 = OpConstant %1 0x1.fffffffffffffp+1024\n",   // -nan
-    }),);
+    }));
 // clang-format on
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     OpSpecConstantRoundTrip, RoundTripTest,
     ::testing::ValuesIn(std::vector<std::string>{
         // 16 bit
@@ -632,7 +632,7 @@ INSTANTIATE_TEST_CASE_P(
         "%1 = OpTypeFloat 64\n%2 = OpSpecConstant %1 0\n",
         "%1 = OpTypeFloat 64\n%2 = OpSpecConstant %1 1.79767e+308\n",
         "%1 = OpTypeFloat 64\n%2 = OpSpecConstant %1 -1.79767e+308\n",
-    }), );
+    }));
 
 // Test OpSpecConstantOp
 
@@ -662,7 +662,7 @@ TEST_P(OpSpecConstantOpTestWithIds, Assembly) {
 #define CASE4(NAME) { SpvOp##NAME, #NAME, {3, 4, 5, 6} }
 #define CASE5(NAME) { SpvOp##NAME, #NAME, {3, 4, 5, 6, 7} }
 #define CASE6(NAME) { SpvOp##NAME, #NAME, {3, 4, 5, 6, 7, 8} }
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     TextToBinaryOpSpecConstantOp, OpSpecConstantOpTestWithIds,
     ::testing::ValuesIn(std::vector<EnumCase<SpvOp>>{
         // Conversion
@@ -738,7 +738,7 @@ INSTANTIATE_TEST_CASE_P(
         CASE2(InBoundsPtrAccessChain),
         CASE3(InBoundsPtrAccessChain),
         CASE6(InBoundsPtrAccessChain),
-    }),);
+    }));
 #undef CASE1
 #undef CASE2
 #undef CASE3
@@ -768,7 +768,7 @@ TEST_P(OpSpecConstantOpTestWithTwoIdsThenLiteralNumbers, Assembly) {
 }
 
 #define CASE(NAME) SpvOp##NAME, #NAME
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     TextToBinaryOpSpecConstantOp,
     OpSpecConstantOpTestWithTwoIdsThenLiteralNumbers,
     ::testing::ValuesIn(std::vector<EnumCase<SpvOp>>{
@@ -783,7 +783,7 @@ INSTANTIATE_TEST_CASE_P(
         // composite, and then literal indices.
         {CASE(CompositeInsert), {0}},
         {CASE(CompositeInsert), {4, 3, 99, 1}},
-    }), );
+    }));
 
 using OpSpecConstantOpTestWithOneIdThenLiteralNumbers =
     spvtest::TextToBinaryTestBase<::testing::TestWithParam<EnumCase<SpvOp>>>;
@@ -806,7 +806,7 @@ TEST_P(OpSpecConstantOpTestWithOneIdThenLiteralNumbers, Assembly) {
 }
 
 #define CASE(NAME) SpvOp##NAME, #NAME
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     TextToBinaryOpSpecConstantOp,
     OpSpecConstantOpTestWithOneIdThenLiteralNumbers,
     ::testing::ValuesIn(std::vector<EnumCase<SpvOp>>{
@@ -814,7 +814,7 @@ INSTANTIATE_TEST_CASE_P(
         // indices.  Let's only test a few.
         {CASE(CompositeExtract), {0}},
         {CASE(CompositeExtract), {0, 99, 42, 16, 17, 12, 19}},
-    }), );
+    }));
 
 // TODO(dneto): OpConstantTrue
 // TODO(dneto): OpConstantFalse

+ 16 - 16
3rdparty/spirv-tools/test/text_to_binary.control_flow_test.cpp

@@ -51,12 +51,12 @@ TEST_P(OpSelectionMergeTest, AnySingleSelectionControlMask) {
 
 // clang-format off
 #define CASE(VALUE,NAME) { SpvSelectionControl##VALUE, NAME}
-INSTANTIATE_TEST_CASE_P(TextToBinarySelectionMerge, OpSelectionMergeTest,
+INSTANTIATE_TEST_SUITE_P(TextToBinarySelectionMerge, OpSelectionMergeTest,
                         ValuesIn(std::vector<EnumCase<SpvSelectionControlMask>>{
                             CASE(MaskNone, "None"),
                             CASE(FlattenMask, "Flatten"),
                             CASE(DontFlattenMask, "DontFlatten"),
-                        }),);
+                        }));
 #undef CASE
 // clang-format on
 
@@ -95,7 +95,7 @@ TEST_P(OpLoopMergeTest, AnySingleLoopControlMask) {
   {                                       \
     SpvLoopControl##VALUE, NAME, { PARM } \
   }
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     TextToBinaryLoopMerge, OpLoopMergeTest,
     Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
             ValuesIn(std::vector<EnumCase<int>>{
@@ -104,9 +104,9 @@ INSTANTIATE_TEST_CASE_P(
                 CASE(UnrollMask, "Unroll"),
                 CASE(DontUnrollMask, "DontUnroll"),
                 // clang-format on
-            })), );
+            })));
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     TextToBinaryLoopMergeV11, OpLoopMergeTest,
     Combine(Values(SPV_ENV_UNIVERSAL_1_1),
             ValuesIn(std::vector<EnumCase<int>>{
@@ -116,7 +116,7 @@ INSTANTIATE_TEST_CASE_P(
                 {SpvLoopControlUnrollMask|SpvLoopControlDependencyLengthMask,
                       "DependencyLength|Unroll", {33}},
                 // clang-format on
-            })), );
+            })));
 #undef CASE
 #undef CASE1
 
@@ -251,7 +251,7 @@ SwitchTestCase MakeSwitchTestCase(uint32_t integer_width,
                            Concatenate({{2, 3}, encoded_case_value, {4}}))})}};
 }
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     TextToBinaryOpSwitchValid1Word, OpSwitchValidTest,
     ValuesIn(std::vector<SwitchTestCase>({
         MakeSwitchTestCase(32, 0, "42", {42}, "100", {100}),
@@ -270,10 +270,10 @@ INSTANTIATE_TEST_CASE_P(
         MakeSwitchTestCase(16, 1, "0x8000", {0xffff8000}, "0x8100",
                            {0xffff8100}),
         MakeSwitchTestCase(16, 0, "0x8000", {0x00008000}, "0x8100", {0x8100}),
-    })), );
+    })));
 
 // NB: The words LOW ORDER bits show up first.
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     TextToBinaryOpSwitchValid2Words, OpSwitchValidTest,
     ValuesIn(std::vector<SwitchTestCase>({
         MakeSwitchTestCase(33, 0, "101", {101, 0}, "500", {500, 0}),
@@ -291,9 +291,9 @@ INSTANTIATE_TEST_CASE_P(
         MakeSwitchTestCase(63, 0, "0x500000000", {0, 5}, "12", {12, 0}),
         MakeSwitchTestCase(64, 0, "0x600000000", {0, 6}, "12", {12, 0}),
         MakeSwitchTestCase(64, 1, "0x700000123", {0x123, 7}, "12", {12, 0}),
-    })), );
+    })));
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     OpSwitchRoundTripUnsignedIntegers, RoundTripTest,
     ValuesIn(std::vector<std::string>({
         // Unsigned 16-bit.
@@ -307,9 +307,9 @@ INSTANTIATE_TEST_CASE_P(
         // Unsigned 64-bit, three non-default cases.
         "%1 = OpTypeInt 64 0\n%2 = OpConstant %1 9223372036854775807\n"
         "OpSwitch %2 %3 100 %4 102 %5 9000000000000000000 %6\n",
-    })), );
+    })));
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     OpSwitchRoundTripSignedIntegers, RoundTripTest,
     ValuesIn(std::vector<std::string>{
         // Signed 16-bit, with two non-default cases
@@ -332,7 +332,7 @@ INSTANTIATE_TEST_CASE_P(
         "OpSwitch %2 %3 100 %4 7000000000 %5 -1000000000000000000 %6\n",
         "%1 = OpTypeInt 64 1\n%2 = OpConstant %1 -9223372036854775808\n"
         "OpSwitch %2 %3 100 %4 7000000000 %5 -1000000000000000000 %6\n",
-    }), );
+    }));
 
 using OpSwitchInvalidTypeTestCase =
     spvtest::TextToBinaryTestBase<TestWithParam<std::string>>;
@@ -349,7 +349,7 @@ TEST_P(OpSwitchInvalidTypeTestCase, InvalidTypes) {
 }
 
 // clang-format off
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     TextToBinaryOpSwitchInvalidTests, OpSwitchInvalidTypeTestCase,
     ValuesIn(std::vector<std::string>{
       {"OpTypeVoid",
@@ -375,7 +375,7 @@ INSTANTIATE_TEST_CASE_P(
            // At least one thing that isn't a type at all
        "OpNot %a %b"
       },
-    }),);
+    }));
 // clang-format on
 
 // TODO(dneto): OpPhi

+ 18 - 18
3rdparty/spirv-tools/test/text_to_binary.debug_test.cpp

@@ -73,8 +73,8 @@ TEST_P(OpSourceTest, AnyLanguage) {
                                                GetParam().version})));
 }
 
-INSTANTIATE_TEST_CASE_P(TextToBinaryTestDebug, OpSourceTest,
-                        ::testing::ValuesIn(kLanguageCases), );
+INSTANTIATE_TEST_SUITE_P(TextToBinaryTestDebug, OpSourceTest,
+                         ::testing::ValuesIn(kLanguageCases));
 
 TEST_F(OpSourceTest, WrongLanguage) {
   EXPECT_THAT(CompileFailure("OpSource xxyyzz 12345"),
@@ -113,9 +113,9 @@ TEST_P(OpSourceContinuedTest, AnyExtension) {
 }
 
 // TODO(dneto): utf-8, quoting, escaping
-INSTANTIATE_TEST_CASE_P(TextToBinaryTestDebug, OpSourceContinuedTest,
-                        ::testing::ValuesIn(std::vector<const char*>{
-                            "", "foo bar this and that"}), );
+INSTANTIATE_TEST_SUITE_P(TextToBinaryTestDebug, OpSourceContinuedTest,
+                         ::testing::ValuesIn(std::vector<const char*>{
+                             "", "foo bar this and that"}));
 
 // Test OpSourceExtension
 
@@ -132,9 +132,9 @@ TEST_P(OpSourceExtensionTest, AnyExtension) {
 }
 
 // TODO(dneto): utf-8, quoting, escaping
-INSTANTIATE_TEST_CASE_P(TextToBinaryTestDebug, OpSourceExtensionTest,
-                        ::testing::ValuesIn(std::vector<const char*>{
-                            "", "foo bar this and that"}), );
+INSTANTIATE_TEST_SUITE_P(TextToBinaryTestDebug, OpSourceExtensionTest,
+                         ::testing::ValuesIn(std::vector<const char*>{
+                             "", "foo bar this and that"}));
 
 TEST_F(TextToBinaryTest, OpLine) {
   EXPECT_THAT(CompiledInstructions("OpLine %srcfile 42 99"),
@@ -158,9 +158,9 @@ TEST_P(OpStringTest, AnyString) {
 }
 
 // TODO(dneto): utf-8, quoting, escaping
-INSTANTIATE_TEST_CASE_P(TextToBinaryTestDebug, OpStringTest,
-                        ::testing::ValuesIn(std::vector<const char*>{
-                            "", "foo bar this and that"}), );
+INSTANTIATE_TEST_SUITE_P(TextToBinaryTestDebug, OpStringTest,
+                         ::testing::ValuesIn(std::vector<const char*>{
+                             "", "foo bar this and that"}));
 
 using OpNameTest =
     spvtest::TextToBinaryTestBase<::testing::TestWithParam<const char*>>;
@@ -174,8 +174,8 @@ TEST_P(OpNameTest, AnyString) {
 
 // UTF-8, quoting, escaping, etc. are covered in the StringLiterals tests in
 // BinaryToText.Literal.cpp.
-INSTANTIATE_TEST_CASE_P(TextToBinaryTestDebug, OpNameTest,
-                        ::testing::Values("", "foo bar this and that"), );
+INSTANTIATE_TEST_SUITE_P(TextToBinaryTestDebug, OpNameTest,
+                         ::testing::Values("", "foo bar this and that"));
 
 using OpMemberNameTest =
     spvtest::TextToBinaryTestBase<::testing::TestWithParam<const char*>>;
@@ -190,9 +190,9 @@ TEST_P(OpMemberNameTest, AnyString) {
 }
 
 // TODO(dneto): utf-8, quoting, escaping
-INSTANTIATE_TEST_CASE_P(TextToBinaryTestDebug, OpMemberNameTest,
-                        ::testing::ValuesIn(std::vector<const char*>{
-                            "", "foo bar this and that"}), );
+INSTANTIATE_TEST_SUITE_P(TextToBinaryTestDebug, OpMemberNameTest,
+                         ::testing::ValuesIn(std::vector<const char*>{
+                             "", "foo bar this and that"}));
 
 // TODO(dneto): Parse failures?
 
@@ -207,8 +207,8 @@ TEST_P(OpModuleProcessedTest, AnyString) {
       Eq(MakeInstruction(SpvOpModuleProcessed, MakeVector(GetParam()))));
 }
 
-INSTANTIATE_TEST_CASE_P(TextToBinaryTestDebug, OpModuleProcessedTest,
-                        ::testing::Values("", "foo bar this and that"), );
+INSTANTIATE_TEST_SUITE_P(TextToBinaryTestDebug, OpModuleProcessedTest,
+                         ::testing::Values("", "foo bar this and that"));
 
 }  // namespace
 }  // namespace spvtools

+ 2 - 2
3rdparty/spirv-tools/test/text_to_binary.device_side_enqueue_test.cpp

@@ -49,7 +49,7 @@ TEST_P(OpEnqueueKernelGood, Sample) {
                                  GetParam().local_size_operands)));
 }
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     TextToBinaryTest, OpEnqueueKernelGood,
     ::testing::ValuesIn(std::vector<KernelEnqueueCase>{
         // Provide IDs for pointer-to-local arguments for the
@@ -71,7 +71,7 @@ INSTANTIATE_TEST_CASE_P(
          {13, 14, 15, 16, 17, 18, 19, 20, 21}},
         {"%l0 %l1 %l2 %l3 %l4 %l5 %l6 %l7 %l8 %l9",
          {13, 14, 15, 16, 17, 18, 19, 20, 21, 22}},
-    }), );
+    }));
 
 // Test some bad parses of OpEnqueueKernel.  For other cases, we're relying
 // on the uniformity of the parsing algorithm.  The following two tests, ensure

+ 42 - 42
3rdparty/spirv-tools/test/text_to_binary.extension_test.cpp

@@ -135,7 +135,7 @@ TEST_P(ExtensionRoundTripTest, Samples) {
 
 // SPV_KHR_shader_ballot
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     SPV_KHR_shader_ballot, ExtensionRoundTripTest,
     // We'll get coverage over operand tables by trying the universal
     // environments, and at least one specific environment.
@@ -164,9 +164,9 @@ INSTANTIATE_TEST_CASE_P(
                 {"OpDecorate %1 BuiltIn SubgroupLtMask\n",
                  MakeInstruction(SpvOpDecorate, {1, SpvDecorationBuiltIn,
                                                  SpvBuiltInSubgroupLtMaskKHR})},
-            })), );
+            })));
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     SPV_KHR_shader_ballot_vulkan_1_1, ExtensionRoundTripTest,
     // In SPIR-V 1.3 and Vulkan 1.1 we can drop the KHR suffix on the
     // builtin enums.
@@ -194,11 +194,11 @@ INSTANTIATE_TEST_CASE_P(
                 {"OpDecorate %1 BuiltIn SubgroupLtMask\n",
                  MakeInstruction(SpvOpDecorate, {1, SpvDecorationBuiltIn,
                                                  SpvBuiltInSubgroupLtMask})},
-            })), );
+            })));
 
 // The old builtin names (with KHR suffix) still work in the assmebler, and
 // map to the enums without the KHR.
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     SPV_KHR_shader_ballot_vulkan_1_1_alias_check, ExtensionAssemblyTest,
     // In SPIR-V 1.3 and Vulkan 1.1 we can drop the KHR suffix on the
     // builtin enums.
@@ -219,11 +219,11 @@ INSTANTIATE_TEST_CASE_P(
                 {"OpDecorate %1 BuiltIn SubgroupLtMaskKHR\n",
                  MakeInstruction(SpvOpDecorate, {1, SpvDecorationBuiltIn,
                                                  SpvBuiltInSubgroupLtMask})},
-            })), );
+            })));
 
 // SPV_KHR_shader_draw_parameters
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     SPV_KHR_shader_draw_parameters, ExtensionRoundTripTest,
     // We'll get coverage over operand tables by trying the universal
     // environments, and at least one specific environment.
@@ -241,11 +241,11 @@ INSTANTIATE_TEST_CASE_P(
             {"OpDecorate %1 BuiltIn DrawIndex\n",
              MakeInstruction(SpvOpDecorate,
                              {1, SpvDecorationBuiltIn, SpvBuiltInDrawIndex})},
-        })), );
+        })));
 
 // SPV_KHR_subgroup_vote
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     SPV_KHR_subgroup_vote, ExtensionRoundTripTest,
     // We'll get coverage over operand tables by trying the universal
     // environments, and at least one specific environment.
@@ -260,11 +260,11 @@ INSTANTIATE_TEST_CASE_P(
                  MakeInstruction(SpvOpSubgroupAllKHR, {1, 2, 3})},
                 {"%2 = OpSubgroupAllEqualKHR %1 %3\n",
                  MakeInstruction(SpvOpSubgroupAllEqualKHR, {1, 2, 3})},
-            })), );
+            })));
 
 // SPV_KHR_16bit_storage
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     SPV_KHR_16bit_storage, ExtensionRoundTripTest,
     // We'll get coverage over operand tables by trying the universal
     // environments, and at least one specific environment.
@@ -289,9 +289,9 @@ INSTANTIATE_TEST_CASE_P(
                 {"OpCapability StorageInputOutput16\n",
                  MakeInstruction(SpvOpCapability,
                                  {SpvCapabilityStorageInputOutput16})},
-            })), );
+            })));
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     SPV_KHR_16bit_storage_alias_check, ExtensionAssemblyTest,
     Combine(ValuesIn(CommonVulkanEnvs()),
             ValuesIn(std::vector<AssemblyCase>{
@@ -303,11 +303,11 @@ INSTANTIATE_TEST_CASE_P(
                 {"OpCapability UniformAndStorageBuffer16BitAccess\n",
                  MakeInstruction(SpvOpCapability,
                                  {SpvCapabilityStorageUniform16})},
-            })), );
+            })));
 
 // SPV_KHR_device_group
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     SPV_KHR_device_group, ExtensionRoundTripTest,
     // We'll get coverage over operand tables by trying the universal
     // environments, and at least one specific environment.
@@ -318,11 +318,11 @@ INSTANTIATE_TEST_CASE_P(
                 {"OpDecorate %1 BuiltIn DeviceIndex\n",
                  MakeInstruction(SpvOpDecorate, {1, SpvDecorationBuiltIn,
                                                  SpvBuiltInDeviceIndex})},
-            })), );
+            })));
 
 // SPV_KHR_8bit_storage
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     SPV_KHR_8bit_storage, ExtensionRoundTripTest,
     // We'll get coverage over operand tables by trying the universal
     // environments, and at least one specific environment.
@@ -338,11 +338,11 @@ INSTANTIATE_TEST_CASE_P(
             {"OpCapability StoragePushConstant8\n",
              MakeInstruction(SpvOpCapability,
                              {SpvCapabilityStoragePushConstant8})},
-        })), );
+        })));
 
 // SPV_KHR_multiview
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     SPV_KHR_multiview, ExtensionRoundTripTest,
     // We'll get coverage over operand tables by trying the universal
     // environments, and at least one specific environment.
@@ -354,13 +354,13 @@ INSTANTIATE_TEST_CASE_P(
                 {"OpDecorate %1 BuiltIn ViewIndex\n",
                  MakeInstruction(SpvOpDecorate, {1, SpvDecorationBuiltIn,
                                                  SpvBuiltInViewIndex})},
-            })), );
+            })));
 
 // SPV_AMD_shader_explicit_vertex_parameter
 
 #define PREAMBLE \
   "%1 = OpExtInstImport \"SPV_AMD_shader_explicit_vertex_parameter\"\n"
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     SPV_AMD_shader_explicit_vertex_parameter, ExtensionRoundTripTest,
     // We'll get coverage over operand tables by trying the universal
     // environments, and at least one specific environment.
@@ -374,13 +374,13 @@ INSTANTIATE_TEST_CASE_P(
                       SpvOpExtInstImport, {1},
                       MakeVector("SPV_AMD_shader_explicit_vertex_parameter")),
                   MakeInstruction(SpvOpExtInst, {2, 3, 1, 1, 4, 5})})},
-        })), );
+        })));
 #undef PREAMBLE
 
 // SPV_AMD_shader_trinary_minmax
 
 #define PREAMBLE "%1 = OpExtInstImport \"SPV_AMD_shader_trinary_minmax\"\n"
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     SPV_AMD_shader_trinary_minmax, ExtensionRoundTripTest,
     // We'll get coverage over operand tables by trying the universal
     // environments, and at least one specific environment.
@@ -433,13 +433,13 @@ INSTANTIATE_TEST_CASE_P(
                  {MakeInstruction(SpvOpExtInstImport, {1},
                                   MakeVector("SPV_AMD_shader_trinary_minmax")),
                   MakeInstruction(SpvOpExtInst, {2, 3, 1, 9, 4, 5, 6})})},
-        })), );
+        })));
 #undef PREAMBLE
 
 // SPV_AMD_gcn_shader
 
 #define PREAMBLE "%1 = OpExtInstImport \"SPV_AMD_gcn_shader\"\n"
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     SPV_AMD_gcn_shader, ExtensionRoundTripTest,
     // We'll get coverage over operand tables by trying the universal
     // environments, and at least one specific environment.
@@ -458,13 +458,13 @@ INSTANTIATE_TEST_CASE_P(
                  Concatenate({MakeInstruction(SpvOpExtInstImport, {1},
                                               MakeVector("SPV_AMD_gcn_shader")),
                               MakeInstruction(SpvOpExtInst, {2, 3, 1, 3})})},
-            })), );
+            })));
 #undef PREAMBLE
 
 // SPV_AMD_shader_ballot
 
 #define PREAMBLE "%1 = OpExtInstImport \"SPV_AMD_shader_ballot\"\n"
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     SPV_AMD_shader_ballot, ExtensionRoundTripTest,
     // We'll get coverage over operand tables by trying the universal
     // environments, and at least one specific environment.
@@ -490,12 +490,12 @@ INSTANTIATE_TEST_CASE_P(
              Concatenate({MakeInstruction(SpvOpExtInstImport, {1},
                                           MakeVector("SPV_AMD_shader_ballot")),
                           MakeInstruction(SpvOpExtInst, {2, 3, 1, 4, 4})})},
-        })), );
+        })));
 #undef PREAMBLE
 
 // SPV_KHR_variable_pointers
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     SPV_KHR_variable_pointers, ExtensionRoundTripTest,
     // We'll get coverage over operand tables by trying the universal
     // environments, and at least one specific environment.
@@ -508,11 +508,11 @@ INSTANTIATE_TEST_CASE_P(
                 {"OpCapability VariablePointersStorageBuffer\n",
                  MakeInstruction(SpvOpCapability,
                                  {SpvCapabilityVariablePointersStorageBuffer})},
-            })), );
+            })));
 
 // SPV_KHR_vulkan_memory_model
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     SPV_KHR_vulkan_memory_model, ExtensionRoundTripTest,
     // We'll get coverage over operand tables by trying the universal
     // environments, and at least one specific environment.
@@ -652,11 +652,11 @@ INSTANTIATE_TEST_CASE_P(
             // constant integer referenced by Id. There is no token for
             // them, and so no assembler or disassembler support required.
             // Similar for Scope ID.
-        })), );
+        })));
 
 // SPV_GOOGLE_decorate_string
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     SPV_GOOGLE_decorate_string, ExtensionRoundTripTest,
     Combine(
         // We'll get coverage over operand tables by trying the universal
@@ -672,11 +672,11 @@ INSTANTIATE_TEST_CASE_P(
              MakeInstruction(SpvOpMemberDecorateStringGOOGLE,
                              {1, 3, SpvDecorationHlslSemanticGOOGLE},
                              MakeVector("DEF"))},
-        })), );
+        })));
 
 // SPV_GOOGLE_hlsl_functionality1
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     SPV_GOOGLE_hlsl_functionality1, ExtensionRoundTripTest,
     Combine(
         // We'll get coverage over operand tables by trying the universal
@@ -689,11 +689,11 @@ INSTANTIATE_TEST_CASE_P(
             {"OpDecorateId %1 HlslCounterBufferGOOGLE %2\n",
              MakeInstruction(SpvOpDecorateId,
                              {1, SpvDecorationHlslCounterBufferGOOGLE, 2})},
-        })), );
+        })));
 
 // SPV_NV_viewport_array2
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     SPV_NV_viewport_array2, ExtensionRoundTripTest,
     Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1,
                    SPV_ENV_UNIVERSAL_1_2, SPV_ENV_UNIVERSAL_1_3,
@@ -717,11 +717,11 @@ INSTANTIATE_TEST_CASE_P(
                 {"OpDecorate %1 BuiltIn ViewportMaskNV\n",
                  MakeInstruction(SpvOpDecorate, {1, SpvDecorationBuiltIn,
                                                  SpvBuiltInViewportMaskNV})},
-            })), );
+            })));
 
 // SPV_NV_shader_subgroup_partitioned
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     SPV_NV_shader_subgroup_partitioned, ExtensionRoundTripTest,
     Combine(
         Values(SPV_ENV_UNIVERSAL_1_3, SPV_ENV_VULKAN_1_1),
@@ -759,11 +759,11 @@ INSTANTIATE_TEST_CASE_P(
                               SpvGroupOperationPartitionedExclusiveScanNV, 4})},
             {"%2 = OpGroupIAdd %1 %3 PartitionedExclusiveScanNV %4\n",
              MakeInstruction(SpvOpGroupIAdd, {1, 2, 3, 8, 4})},
-        })), );
+        })));
 
 // SPV_EXT_descriptor_indexing
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     SPV_EXT_descriptor_indexing, ExtensionRoundTripTest,
     Combine(
         Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1,
@@ -851,7 +851,7 @@ INSTANTIATE_TEST_CASE_P(
              MakeInstruction(SpvOpDecorate, {1, SpvDecorationNonUniformEXT})},
             {"OpDecorate %1 NonUniformEXT\n",
              MakeInstruction(SpvOpDecorate, {1, 5300})},
-        })), );
+        })));
 
 }  // namespace
 }  // namespace spvtools

+ 2 - 2
3rdparty/spirv-tools/test/text_to_binary.function_test.cpp

@@ -45,14 +45,14 @@ TEST_P(OpFunctionControlTest, AnySingleFunctionControlMask) {
 
 // clang-format off
 #define CASE(VALUE,NAME) { SpvFunctionControl##VALUE, NAME }
-INSTANTIATE_TEST_CASE_P(TextToBinaryFunctionTest, OpFunctionControlTest,
+INSTANTIATE_TEST_SUITE_P(TextToBinaryFunctionTest, OpFunctionControlTest,
                         ::testing::ValuesIn(std::vector<EnumCase<SpvFunctionControlMask>>{
                             CASE(MaskNone, "None"),
                             CASE(InlineMask, "Inline"),
                             CASE(DontInlineMask, "DontInline"),
                             CASE(PureMask, "Pure"),
                             CASE(ConstMask, "Const"),
-                        }),);
+                        }));
 #undef CASE
 // clang-format on
 

+ 2 - 2
3rdparty/spirv-tools/test/text_to_binary.group_test.cpp

@@ -44,12 +44,12 @@ TEST_P(GroupOperationTest, AnyGroupOperation) {
 
 // clang-format off
 #define CASE(NAME) { SpvGroupOperation##NAME, #NAME}
-INSTANTIATE_TEST_CASE_P(TextToBinaryGroupOperation, GroupOperationTest,
+INSTANTIATE_TEST_SUITE_P(TextToBinaryGroupOperation, GroupOperationTest,
                         ::testing::ValuesIn(std::vector<EnumCase<SpvGroupOperation>>{
                             CASE(Reduce),
                             CASE(InclusiveScan),
                             CASE(ExclusiveScan),
-                        }),);
+                        }));
 #undef CASE
 // clang-format on
 

+ 21 - 21
3rdparty/spirv-tools/test/text_to_binary.image_test.cpp

@@ -50,7 +50,7 @@ TEST_P(ImageOperandsTest, Sample) {
 }
 
 #define MASK(NAME) SpvImageOperands##NAME##Mask
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     TextToBinaryImageOperandsAny, ImageOperandsTest,
     ::testing::ValuesIn(std::vector<ImageOperandsCase>{
         // TODO(dneto): Rev32 adds many more values, and rearranges their
@@ -66,10 +66,10 @@ INSTANTIATE_TEST_CASE_P(
         {" ConstOffsets %5", {MASK(ConstOffsets), 5}},
         {" Sample %5", {MASK(Sample), 5}},
         {" MinLod %5", {MASK(MinLod), 5}},
-    }), );
+    }));
 #undef MASK
 #define MASK(NAME) static_cast<uint32_t>(SpvImageOperands##NAME##Mask)
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     TextToBinaryImageOperandsCombination, ImageOperandsTest,
     ::testing::ValuesIn(std::vector<ImageOperandsCase>{
         // TODO(dneto): Rev32 adds many more values, and rearranges their
@@ -95,7 +95,7 @@ INSTANTIATE_TEST_CASE_P(
          " %5 %6 %7 %8 %9 %10 %11 %12",
          {MASK(Bias) | MASK(Lod) | MASK(Grad) | MASK(ConstOffset) |
               MASK(Offset) | MASK(ConstOffsets) | MASK(Sample),
-          5, 6, 7, 8, 9, 10, 11, 12}}}), );
+          5, 6, 7, 8, 9, 10, 11, 12}}}));
 #undef MASK
 
 TEST_F(ImageOperandsTest, WrongOperand) {
@@ -173,24 +173,24 @@ TEST_P(ImageSparseReadImageOperandsTest, Sample) {
 }
 
 #define MASK(NAME) SpvImageOperands##NAME##Mask
-INSTANTIATE_TEST_CASE_P(ImageSparseReadImageOperandsAny,
-                        ImageSparseReadImageOperandsTest,
-                        ::testing::ValuesIn(std::vector<ImageOperandsCase>{
-                            // Image operands are optional.
-                            {"", {}},
-                            // Test each kind, alone.
-                            {" Bias %5", {MASK(Bias), 5}},
-                            {" Lod %5", {MASK(Lod), 5}},
-                            {" Grad %5 %6", {MASK(Grad), 5, 6}},
-                            {" ConstOffset %5", {MASK(ConstOffset), 5}},
-                            {" Offset %5", {MASK(Offset), 5}},
-                            {" ConstOffsets %5", {MASK(ConstOffsets), 5}},
-                            {" Sample %5", {MASK(Sample), 5}},
-                            {" MinLod %5", {MASK(MinLod), 5}},
-                        }), );
+INSTANTIATE_TEST_SUITE_P(ImageSparseReadImageOperandsAny,
+                         ImageSparseReadImageOperandsTest,
+                         ::testing::ValuesIn(std::vector<ImageOperandsCase>{
+                             // Image operands are optional.
+                             {"", {}},
+                             // Test each kind, alone.
+                             {" Bias %5", {MASK(Bias), 5}},
+                             {" Lod %5", {MASK(Lod), 5}},
+                             {" Grad %5 %6", {MASK(Grad), 5, 6}},
+                             {" ConstOffset %5", {MASK(ConstOffset), 5}},
+                             {" Offset %5", {MASK(Offset), 5}},
+                             {" ConstOffsets %5", {MASK(ConstOffsets), 5}},
+                             {" Sample %5", {MASK(Sample), 5}},
+                             {" MinLod %5", {MASK(MinLod), 5}},
+                         }));
 #undef MASK
 #define MASK(NAME) static_cast<uint32_t>(SpvImageOperands##NAME##Mask)
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     ImageSparseReadImageOperandsCombination, ImageSparseReadImageOperandsTest,
     ::testing::ValuesIn(std::vector<ImageOperandsCase>{
         // values.
@@ -212,7 +212,7 @@ INSTANTIATE_TEST_CASE_P(
           5, 6, 7, 8, 9, 10, 11, 12}},
         // Don't try the masks reversed, since this is a round trip test,
         // and the disassembler will sort them.
-    }), );
+    }));
 #undef MASK
 
 TEST_F(OpImageSparseReadTest, InvalidTypeOperand) {

+ 4 - 4
3rdparty/spirv-tools/test/text_to_binary.memory_test.cpp

@@ -45,14 +45,14 @@ TEST_P(MemoryAccessTest, AnySingleMemoryAccessMask) {
                                  GetParam().operands())));
 }
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     TextToBinaryMemoryAccessTest, MemoryAccessTest,
     ::testing::ValuesIn(std::vector<EnumCase<SpvMemoryAccessMask>>{
         {SpvMemoryAccessMaskNone, "None", {}},
         {SpvMemoryAccessVolatileMask, "Volatile", {}},
         {SpvMemoryAccessAlignedMask, "Aligned", {16}},
         {SpvMemoryAccessNontemporalMask, "Nontemporal", {}},
-    }), );
+    }));
 
 TEST_F(TextToBinaryTest, CombinedMemoryAccessMask) {
   const std::string input = "OpStore %ptr %value Volatile|Aligned 16";
@@ -76,7 +76,7 @@ TEST_P(StorageClassTest, AnyStorageClass) {
 
 // clang-format off
 #define CASE(NAME) { SpvStorageClass##NAME, #NAME, {} }
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     TextToBinaryStorageClassTest, StorageClassTest,
     ::testing::ValuesIn(std::vector<EnumCase<SpvStorageClass>>{
         CASE(UniformConstant),
@@ -91,7 +91,7 @@ INSTANTIATE_TEST_CASE_P(
         CASE(PushConstant),
         CASE(AtomicCounter),
         CASE(Image),
-    }),);
+    }));
 #undef CASE
 // clang-format on
 

+ 10 - 10
3rdparty/spirv-tools/test/text_to_binary.mode_setting_test.cpp

@@ -69,7 +69,7 @@ TEST_P(OpMemoryModelTest, AnyMemoryModelCase) {
         #MEMORY                                                          \
   }
 // clang-format off
-INSTANTIATE_TEST_CASE_P(TextToBinaryMemoryModel, OpMemoryModelTest,
+INSTANTIATE_TEST_SUITE_P(TextToBinaryMemoryModel, OpMemoryModelTest,
                         ValuesIn(std::vector<MemoryModelCase>{
                           // These cases exercise each addressing model, and
                           // each memory model, but not necessarily in
@@ -78,7 +78,7 @@ INSTANTIATE_TEST_CASE_P(TextToBinaryMemoryModel, OpMemoryModelTest,
                             CASE(Logical,GLSL450),
                             CASE(Physical32,OpenCL),
                             CASE(Physical64,OpenCL),
-                        }),);
+                        }));
 #undef CASE
 // clang-format on
 
@@ -116,7 +116,7 @@ TEST_P(OpEntryPointTest, AnyEntryPointCase) {
 
 // clang-format off
 #define CASE(NAME) SpvExecutionModel##NAME, #NAME
-INSTANTIATE_TEST_CASE_P(TextToBinaryEntryPoint, OpEntryPointTest,
+INSTANTIATE_TEST_SUITE_P(TextToBinaryEntryPoint, OpEntryPointTest,
                         ValuesIn(std::vector<EntryPointCase>{
                           { CASE(Vertex), "" },
                           { CASE(TessellationControl), "my tess" },
@@ -125,7 +125,7 @@ INSTANTIATE_TEST_CASE_P(TextToBinaryEntryPoint, OpEntryPointTest,
                           { CASE(Fragment), "FAT32" },
                           { CASE(GLCompute), "cubic" },
                           { CASE(Kernel), "Sanders" },
-                        }),);
+                        }));
 #undef CASE
 // clang-format on
 
@@ -151,7 +151,7 @@ TEST_P(OpExecutionModeTest, AnyExecutionMode) {
 }
 
 #define CASE(NAME) SpvExecutionMode##NAME, #NAME
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     TextToBinaryExecutionMode, OpExecutionModeTest,
     Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1),
             ValuesIn(std::vector<EnumCase<SpvExecutionMode>>{
@@ -188,16 +188,16 @@ INSTANTIATE_TEST_CASE_P(
                 {CASE(OutputTriangleStrip), {}},
                 {CASE(VecTypeHint), {96}},
                 {CASE(ContractionOff), {}},
-            })), );
+            })));
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     TextToBinaryExecutionModeV11, OpExecutionModeTest,
     Combine(Values(SPV_ENV_UNIVERSAL_1_1),
             ValuesIn(std::vector<EnumCase<SpvExecutionMode>>{
                 {CASE(Initializer)},
                 {CASE(Finalizer)},
                 {CASE(SubgroupSize), {12}},
-                {CASE(SubgroupsPerWorkgroup), {64}}})), );
+                {CASE(SubgroupsPerWorkgroup), {64}}})));
 #undef CASE
 
 TEST_F(OpExecutionModeTest, WrongMode) {
@@ -224,7 +224,7 @@ TEST_P(OpCapabilityTest, AnyCapability) {
 
 // clang-format off
 #define CASE(NAME) { SpvCapability##NAME, #NAME }
-INSTANTIATE_TEST_CASE_P(TextToBinaryCapability, OpCapabilityTest,
+INSTANTIATE_TEST_SUITE_P(TextToBinaryCapability, OpCapabilityTest,
                         ValuesIn(std::vector<EnumCase<SpvCapability>>{
                             CASE(Matrix),
                             CASE(Shader),
@@ -280,7 +280,7 @@ INSTANTIATE_TEST_CASE_P(TextToBinaryCapability, OpCapabilityTest,
                             CASE(DerivativeControl),
                             CASE(InterpolationFunction),
                             CASE(TransformFeedback),
-                        }),);
+                        }));
 #undef CASE
 // clang-format on
 

+ 8 - 8
3rdparty/spirv-tools/test/text_to_binary.type_declaration_test.cpp

@@ -48,7 +48,7 @@ TEST_P(DimTest, AnyDim) {
 
 // clang-format off
 #define CASE(NAME) {SpvDim##NAME, #NAME}
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     TextToBinaryDim, DimTest,
     ::testing::ValuesIn(std::vector<EnumCase<SpvDim>>{
         CASE(1D),
@@ -58,7 +58,7 @@ INSTANTIATE_TEST_CASE_P(
         CASE(Rect),
         CASE(Buffer),
         CASE(SubpassData),
-    }),);
+    }));
 #undef CASE
 // clang-format on
 
@@ -84,7 +84,7 @@ TEST_P(ImageFormatTest, AnyImageFormatAndNoAccessQualifier) {
 
 // clang-format off
 #define CASE(NAME) {SpvImageFormat##NAME, #NAME}
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     TextToBinaryImageFormat, ImageFormatTest,
     ::testing::ValuesIn(std::vector<EnumCase<SpvImageFormat>>{
         CASE(Unknown),
@@ -127,7 +127,7 @@ INSTANTIATE_TEST_CASE_P(
         CASE(Rg8ui),
         CASE(R16ui),
         CASE(R8ui),
-    }),);
+    }));
 #undef CASE
 // clang-format on
 
@@ -153,13 +153,13 @@ TEST_P(ImageAccessQualifierTest, AnyAccessQualifier) {
 
 // clang-format off
 #define CASE(NAME) {SpvAccessQualifier##NAME, #NAME}
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     AccessQualifier, ImageAccessQualifierTest,
     ::testing::ValuesIn(std::vector<EnumCase<SpvAccessQualifier>>{
       CASE(ReadOnly),
       CASE(WriteOnly),
       CASE(ReadWrite),
-    }),);
+    }));
 // clang-format on
 #undef CASE
 
@@ -178,13 +178,13 @@ TEST_P(OpTypePipeTest, AnyAccessQualifier) {
 
 // clang-format off
 #define CASE(NAME) {SpvAccessQualifier##NAME, #NAME}
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     TextToBinaryTypePipe, OpTypePipeTest,
     ::testing::ValuesIn(std::vector<EnumCase<SpvAccessQualifier>>{
                             CASE(ReadOnly),
                             CASE(WriteOnly),
                             CASE(ReadWrite),
-    }),);
+    }));
 #undef CASE
 // clang-format on
 

+ 12 - 12
3rdparty/spirv-tools/test/text_to_binary_test.cpp

@@ -58,7 +58,7 @@ TEST_P(GoodMaskParseTest, GoodMaskExpressions) {
   spvContextDestroy(context);
 }
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     ParseMask, GoodMaskParseTest,
     ::testing::ValuesIn(std::vector<MaskCase>{
         {SPV_OPERAND_TYPE_FP_FAST_MATH_MODE, 0, "None"},
@@ -87,7 +87,7 @@ INSTANTIATE_TEST_CASE_P(
         {SPV_OPERAND_TYPE_FUNCTION_CONTROL, 4, "Pure"},
         {SPV_OPERAND_TYPE_FUNCTION_CONTROL, 8, "Const"},
         {SPV_OPERAND_TYPE_FUNCTION_CONTROL, 0xd, "Inline|Const|Pure"},
-    }), );
+    }));
 
 using BadFPFastMathMaskParseTest = ::testing::TestWithParam<const char*>;
 
@@ -102,12 +102,12 @@ TEST_P(BadFPFastMathMaskParseTest, BadMaskExpressions) {
   spvContextDestroy(context);
 }
 
-INSTANTIATE_TEST_CASE_P(ParseMask, BadFPFastMathMaskParseTest,
-                        ::testing::ValuesIn(std::vector<const char*>{
-                            nullptr, "", "NotValidEnum", "|", "NotInf|",
-                            "|NotInf", "NotInf||NotNaN",
-                            "Unroll"  // A good word, but for the wrong enum
-                        }), );
+INSTANTIATE_TEST_SUITE_P(ParseMask, BadFPFastMathMaskParseTest,
+                         ::testing::ValuesIn(std::vector<const char*>{
+                             nullptr, "", "NotValidEnum", "|", "NotInf|",
+                             "|NotInf", "NotInf||NotNaN",
+                             "Unroll"  // A good word, but for the wrong enum
+                         }));
 
 TEST_F(TextToBinaryTest, InvalidText) {
   ASSERT_EQ(SPV_ERROR_INVALID_TEXT,
@@ -197,7 +197,7 @@ TEST_P(TextToBinaryFloatValueTest, Samples) {
                                               {1, 2, GetParam().second})})));
 }
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     FloatValues, TextToBinaryFloatValueTest,
     ::testing::ValuesIn(std::vector<std::pair<std::string, uint32_t>>{
         {"0.0", 0x00000000},          // +0
@@ -213,7 +213,7 @@ INSTANTIATE_TEST_CASE_P(
         {"-2.5", 0xc0200000},
         {"!0xff800000", 0xff800000},  // -inf
         {"!0xff800001", 0xff800001},  // NaN
-    }), );
+    }));
 
 using TextToBinaryHalfValueTest = spvtest::TextToBinaryTestBase<
     ::testing::TestWithParam<std::pair<std::string, uint32_t>>>;
@@ -227,7 +227,7 @@ TEST_P(TextToBinaryHalfValueTest, Samples) {
                                               {1, 2, GetParam().second})})));
 }
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     HalfValues, TextToBinaryHalfValueTest,
     ::testing::ValuesIn(std::vector<std::pair<std::string, uint32_t>>{
         {"0.0", 0x00000000},
@@ -245,7 +245,7 @@ INSTANTIATE_TEST_CASE_P(
         {"0x1.8p4", 0x00004e00},
         {"0x1.801p4", 0x00004e00},
         {"0x1.804p4", 0x00004e01},
-    }), );
+    }));
 
 TEST(CreateContext, InvalidEnvironment) {
   spv_target_env env;

+ 3 - 0
3rdparty/spirv-tools/test/val/CMakeLists.txt

@@ -15,6 +15,8 @@
 set(VAL_TEST_COMMON_SRCS
   ${CMAKE_CURRENT_SOURCE_DIR}/../test_fixture.h
   ${CMAKE_CURRENT_SOURCE_DIR}/../unit_spirv.h
+  ${CMAKE_CURRENT_SOURCE_DIR}/val_code_generator.cpp
+  ${CMAKE_CURRENT_SOURCE_DIR}/val_code_generator.h
   ${CMAKE_CURRENT_SOURCE_DIR}/val_fixtures.h
 )
 
@@ -46,6 +48,7 @@ add_spvtools_unittest(TARGET val_limits
   SRCS val_limits_test.cpp
        ${VAL_TEST_COMMON_SRCS}
   LIBS ${SPIRV_TOOLS}
+  PCH_FILE pch_test_val
 )
 
 add_spvtools_unittest(TARGET val_ijklmnop

Plik diff jest za duży
+ 306 - 337
3rdparty/spirv-tools/test/val/val_builtins_test.cpp


+ 40 - 35
3rdparty/spirv-tools/test/val/val_capability_test.cpp

@@ -611,7 +611,7 @@ const char kVoidFVoid2[] = \
   "           OpReturn"
   "           OpFunctionEnd ";
 
-INSTANTIATE_TEST_CASE_P(ExecutionModel, ValidateCapability,
+INSTANTIATE_TEST_SUITE_P(ExecutionModel, ValidateCapability,
                         Combine(
                             ValuesIn(AllCapabilities()),
                             Values(
@@ -639,9 +639,9 @@ std::make_pair(std::string(kOpenCLMemoryModel) +
 std::make_pair(std::string(kGLSL450MemoryModel) +
           " OpEntryPoint Kernel %func \"shader\"" +
           std::string(kVoidFVoid), KernelDependencies())
-)),);
+)));
 
-INSTANTIATE_TEST_CASE_P(AddressingAndMemoryModel, ValidateCapability,
+INSTANTIATE_TEST_SUITE_P(AddressingAndMemoryModel, ValidateCapability,
                         Combine(
                             ValuesIn(AllCapabilities()),
                             Values(
@@ -681,9 +681,9 @@ std::make_pair(" OpCapability Kernel"
           " OpMemoryModel Physical64 OpenCL"
           " OpEntryPoint Kernel %func \"compute\"" +
           std::string(kVoidFVoid),  AddressesDependencies())
-)),);
+)));
 
-INSTANTIATE_TEST_CASE_P(ExecutionMode, ValidateCapability,
+INSTANTIATE_TEST_SUITE_P(ExecutionMode, ValidateCapability,
                         Combine(
                             ValuesIn(AllCapabilities()),
                             Values(
@@ -836,11 +836,11 @@ std::make_pair(std::string(kGLSL450MemoryModel) +
 std::make_pair(std::string(kGLSL450MemoryModel) +
           "OpEntryPoint Kernel %func \"shader\" "
           "OpExecutionMode %func ContractionOff" +
-          std::string(kVoidFVoid), KernelDependencies()))),);
+          std::string(kVoidFVoid), KernelDependencies()))));
 
 // clang-format on
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     ExecutionModeV11, ValidateCapabilityV11,
     Combine(ValuesIn(AllCapabilities()),
             Values(std::make_pair(std::string(kOpenCLMemoryModel) +
@@ -853,10 +853,10 @@ INSTANTIATE_TEST_CASE_P(
                            "OpEntryPoint Kernel %func \"shader\" "
                            "OpExecutionMode %func SubgroupsPerWorkgroup 65535" +
                            std::string(kVoidFVoid),
-                       std::vector<std::string>{"SubgroupDispatch"}))), );
+                       std::vector<std::string>{"SubgroupDispatch"}))));
 // clang-format off
 
-INSTANTIATE_TEST_CASE_P(StorageClass, ValidateCapability,
+INSTANTIATE_TEST_SUITE_P(StorageClass, ValidateCapability,
                         Combine(
                             ValuesIn(AllCapabilities()),
                             Values(
@@ -920,9 +920,9 @@ std::make_pair(std::string(kGLSL450MemoryModel) +
           " %ptrt = OpTypePointer Image %intt\n"
           " %var = OpVariable %ptrt Image\n" + std::string(kVoidFVoid),
           AllCapabilities())
-)),);
+)));
 
-INSTANTIATE_TEST_CASE_P(Dim, ValidateCapability,
+INSTANTIATE_TEST_SUITE_P(Dim, ValidateCapability,
                         Combine(
                             ValuesIn(AllCapabilities()),
                             Values(
@@ -968,11 +968,11 @@ std::make_pair(" OpCapability ImageBasic" +
           " %voidt = OpTypeVoid"
           " %imgt = OpTypeImage %voidt SubpassData 0 0 0 2 Unknown" + std::string(kVoidFVoid2),
           std::vector<std::string>{"InputAttachment"})
-)),);
+)));
 
 // NOTE: All Sampler Address Modes require kernel capabilities but the
 // OpConstantSampler requires LiteralSampler which depends on Kernel
-INSTANTIATE_TEST_CASE_P(SamplerAddressingMode, ValidateCapability,
+INSTANTIATE_TEST_SUITE_P(SamplerAddressingMode, ValidateCapability,
                         Combine(
                             ValuesIn(AllCapabilities()),
                             Values(
@@ -1006,7 +1006,7 @@ std::make_pair(std::string(kGLSL450MemoryModel) +
           " %sampler = OpConstantSampler %samplert RepeatMirrored 1 Nearest" +
           std::string(kVoidFVoid),
           std::vector<std::string>{"LiteralSampler"})
-)),);
+)));
 
 // TODO(umar): Sampler Filter Mode
 // TODO(umar): Image Format
@@ -1019,7 +1019,7 @@ std::make_pair(std::string(kGLSL450MemoryModel) +
 // TODO(umar): Access Qualifier
 // TODO(umar): Function Parameter Attribute
 
-INSTANTIATE_TEST_CASE_P(Decoration, ValidateCapability,
+INSTANTIATE_TEST_SUITE_P(Decoration, ValidateCapability,
                         Combine(
                             ValuesIn(AllCapabilities()),
                             Values(
@@ -1129,9 +1129,14 @@ std::make_pair(std::string(kOpenCLMemoryModel) +
           "%intt = OpTypeInt 32 0\n" + std::string(kVoidFVoid),
           AllCapabilities()),
 std::make_pair(std::string(kOpenCLMemoryModel) +
+          // NonWritable must target something valid, such as a storage image.
           "OpEntryPoint Kernel %func \"compute\" \n"
-          "OpDecorate %intt NonWritable\n"
-          "%intt = OpTypeInt 32 0\n" + std::string(kVoidFVoid),
+          "OpDecorate %var NonWritable "
+          "%float = OpTypeFloat 32 "
+          "%imstor = OpTypeImage %float 2D 0 0 0 2 Unknown "
+          "%ptr = OpTypePointer UniformConstant %imstor "
+          "%var = OpVariable %ptr UniformConstant "
+          + std::string(kVoidFVoid),
           AllCapabilities()),
 std::make_pair(std::string(kOpenCLMemoryModel) +
           "OpEntryPoint Kernel %func \"compute\" \n"
@@ -1226,10 +1231,10 @@ std::make_pair(std::string(kGLSL450MemoryModel) +
           "OpDecorate %intt Alignment 4\n"
           "%intt = OpTypeInt 32 0\n" + std::string(kVoidFVoid),
           KernelDependencies())
-)),);
+)));
 
 // clang-format on
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     DecorationSpecId, ValidateCapability,
     Combine(
         ValuesIn(AllSpirV10Capabilities()),
@@ -1239,9 +1244,9 @@ INSTANTIATE_TEST_CASE_P(
                                   "%intt = OpTypeInt 32 0\n"
                                   "%1 = OpSpecConstant %intt 0\n" +
                                   std::string(kVoidFVoid),
-                              ShaderDependencies()))), );
+                              ShaderDependencies()))));
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     DecorationV11, ValidateCapabilityV11,
     Combine(ValuesIn(AllCapabilities()),
             Values(std::make_pair(std::string(kOpenCLMemoryModel) +
@@ -1270,10 +1275,10 @@ INSTANTIATE_TEST_CASE_P(
                                    "%intt = OpTypeInt 32 0 "
                                    "%1 = OpSpecConstant %intt 0") +
                            std::string(kVoidFVoid),
-                       ShaderDependencies()))), );
+                       ShaderDependencies()))));
 // clang-format off
 
-INSTANTIATE_TEST_CASE_P(BuiltIn, ValidateCapability,
+INSTANTIATE_TEST_SUITE_P(BuiltIn, ValidateCapability,
                         Combine(
                             ValuesIn(AllCapabilities()),
                             Values(
@@ -1495,13 +1500,13 @@ std::make_pair(std::string(kOpenCLMemoryModel) +
           "OpDecorate %intt BuiltIn InstanceIndex\n"
           "%intt = OpTypeInt 32 0\n" + std::string(kVoidFVoid),
           ShaderDependencies())
-)),);
+)));
 
 // Ensure that mere mention of PointSize, ClipDistance, or CullDistance as
 // BuiltIns does not trigger the requirement for the associated
 // capability.
 // See https://github.com/KhronosGroup/SPIRV-Tools/issues/365
-INSTANTIATE_TEST_CASE_P(BuiltIn, ValidateCapabilityVulkan10,
+INSTANTIATE_TEST_SUITE_P(BuiltIn, ValidateCapabilityVulkan10,
                         Combine(
                             // All capabilities to try.
                             ValuesIn(AllSpirV10Capabilities()),
@@ -1532,9 +1537,9 @@ std::make_pair(std::string(kGLSL450MemoryModel) +
           "%f32arr4 = OpTypeArray %f32 %intt_4\n"
           "%block = OpTypeStruct %f32arr4\n" + std::string(kVoidFVoid),
           AllVulkan10Capabilities())
-)),);
+)));
 
-INSTANTIATE_TEST_CASE_P(BuiltIn, ValidateCapabilityOpenGL40,
+INSTANTIATE_TEST_SUITE_P(BuiltIn, ValidateCapabilityOpenGL40,
                         Combine(
                             // OpenGL 4.0 is based on SPIR-V 1.0
                             ValuesIn(AllSpirV10Capabilities()),
@@ -1554,9 +1559,9 @@ std::make_pair(std::string(kGLSL450MemoryModel) +
           "OpDecorate %intt BuiltIn CullDistance\n"
           "%intt = OpTypeInt 32 0\n" + std::string(kVoidFVoid),
           AllSpirV10Capabilities())
-)),);
+)));
 
-INSTANTIATE_TEST_CASE_P(Capabilities, ValidateCapabilityWebGPU,
+INSTANTIATE_TEST_SUITE_P(Capabilities, ValidateCapabilityWebGPU,
                         Combine(
                             // All capabilities to try.
                             ValuesIn(AllCapabilities()),
@@ -1564,9 +1569,9 @@ INSTANTIATE_TEST_CASE_P(Capabilities, ValidateCapabilityWebGPU,
 std::make_pair(std::string(kVulkanMemoryModel) +
           "OpEntryPoint Vertex %func \"shader\" \n" + std::string(kVoidFVoid),
           AllWebGPUCapabilities())
-)),);
+)));
 
-INSTANTIATE_TEST_CASE_P(Capabilities, ValidateCapabilityVulkan11,
+INSTANTIATE_TEST_SUITE_P(Capabilities, ValidateCapabilityVulkan11,
                         Combine(
                             // All capabilities to try.
                             ValuesIn(AllCapabilities()),
@@ -1581,7 +1586,7 @@ std::make_pair(std::string(kGLSL450MemoryModel) +
           "OpDecorate %intt BuiltIn CullDistance\n"
           "%intt = OpTypeInt 32 0\n" + std::string(kVoidFVoid),
           AllVulkan11Capabilities())
-)),);
+)));
 
 // TODO(umar): Selection Control
 // TODO(umar): Loop Control
@@ -1593,7 +1598,7 @@ std::make_pair(std::string(kGLSL450MemoryModel) +
 // TODO(umar): Kernel Enqueue Flags
 // TODO(umar): Kernel Profiling Flags
 
-INSTANTIATE_TEST_CASE_P(MatrixOp, ValidateCapability,
+INSTANTIATE_TEST_SUITE_P(MatrixOp, ValidateCapability,
                         Combine(
                             ValuesIn(AllCapabilities()),
                             Values(
@@ -1602,7 +1607,7 @@ std::make_pair(std::string(kOpenCLMemoryModel) +
           "%f32      = OpTypeFloat 32\n"
           "%vec3     = OpTypeVector %f32 3\n"
           "%mat33    = OpTypeMatrix %vec3 3\n" + std::string(kVoidFVoid),
-          MatrixDependencies()))),);
+          MatrixDependencies()))));
 // clang-format on
 
 #if 0
@@ -1643,7 +1648,7 @@ OpFunctionEnd
   return ss.str();
 }
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     TwoImageOperandsMask, ValidateCapability,
     Combine(
         ValuesIn(AllCapabilities()),

+ 3 - 3
3rdparty/spirv-tools/test/val/val_cfg_test.cpp

@@ -171,9 +171,9 @@ const char* types_consts() {
   return types;
 }
 
-INSTANTIATE_TEST_CASE_P(StructuredControlFlow, ValidateCFG,
-                        ::testing::Values(SpvCapabilityShader,
-                                          SpvCapabilityKernel));
+INSTANTIATE_TEST_SUITE_P(StructuredControlFlow, ValidateCFG,
+                         ::testing::Values(SpvCapabilityShader,
+                                           SpvCapabilityKernel));
 
 TEST_P(ValidateCFG, LoopReachableFromEntryButNeverLeadingToReturn) {
   // In this case, the loop is reachable from a node without a predecessor,

+ 222 - 0
3rdparty/spirv-tools/test/val/val_code_generator.cpp

@@ -0,0 +1,222 @@
+// Copyright (c) 2019 Google LLC.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "test/val/val_code_generator.h"
+
+#include <sstream>
+
+namespace spvtools {
+namespace val {
+namespace {
+
+std::string GetDefaultShaderCapabilities() {
+  return R"(
+OpCapability Shader
+OpCapability Geometry
+OpCapability Tessellation
+OpCapability Float64
+OpCapability Int64
+OpCapability MultiViewport
+OpCapability SampleRateShading
+)";
+}
+
+std::string GetWebGPUShaderCapabilities() {
+  return R"(
+OpCapability Shader
+OpCapability VulkanMemoryModelKHR
+)";
+}
+
+std::string GetDefaultShaderTypes() {
+  return R"(
+%void = OpTypeVoid
+%func = OpTypeFunction %void
+%bool = OpTypeBool
+%f32 = OpTypeFloat 32
+%f64 = OpTypeFloat 64
+%u32 = OpTypeInt 32 0
+%u64 = OpTypeInt 64 0
+%f32vec2 = OpTypeVector %f32 2
+%f32vec3 = OpTypeVector %f32 3
+%f32vec4 = OpTypeVector %f32 4
+%f64vec2 = OpTypeVector %f64 2
+%f64vec3 = OpTypeVector %f64 3
+%f64vec4 = OpTypeVector %f64 4
+%u32vec2 = OpTypeVector %u32 2
+%u32vec3 = OpTypeVector %u32 3
+%u64vec3 = OpTypeVector %u64 3
+%u32vec4 = OpTypeVector %u32 4
+%u64vec2 = OpTypeVector %u64 2
+
+%f32_0 = OpConstant %f32 0
+%f32_1 = OpConstant %f32 1
+%f32_2 = OpConstant %f32 2
+%f32_3 = OpConstant %f32 3
+%f32_4 = OpConstant %f32 4
+%f32_h = OpConstant %f32 0.5
+%f32vec2_01 = OpConstantComposite %f32vec2 %f32_0 %f32_1
+%f32vec2_12 = OpConstantComposite %f32vec2 %f32_1 %f32_2
+%f32vec3_012 = OpConstantComposite %f32vec3 %f32_0 %f32_1 %f32_2
+%f32vec3_123 = OpConstantComposite %f32vec3 %f32_1 %f32_2 %f32_3
+%f32vec4_0123 = OpConstantComposite %f32vec4 %f32_0 %f32_1 %f32_2 %f32_3
+%f32vec4_1234 = OpConstantComposite %f32vec4 %f32_1 %f32_2 %f32_3 %f32_4
+
+%f64_0 = OpConstant %f64 0
+%f64_1 = OpConstant %f64 1
+%f64_2 = OpConstant %f64 2
+%f64_3 = OpConstant %f64 3
+%f64vec2_01 = OpConstantComposite %f64vec2 %f64_0 %f64_1
+%f64vec3_012 = OpConstantComposite %f64vec3 %f64_0 %f64_1 %f64_2
+%f64vec4_0123 = OpConstantComposite %f64vec4 %f64_0 %f64_1 %f64_2 %f64_3
+
+%u32_0 = OpConstant %u32 0
+%u32_1 = OpConstant %u32 1
+%u32_2 = OpConstant %u32 2
+%u32_3 = OpConstant %u32 3
+%u32_4 = OpConstant %u32 4
+
+%u64_0 = OpConstant %u64 0
+%u64_1 = OpConstant %u64 1
+%u64_2 = OpConstant %u64 2
+%u64_3 = OpConstant %u64 3
+
+%u32vec2_01 = OpConstantComposite %u32vec2 %u32_0 %u32_1
+%u32vec2_12 = OpConstantComposite %u32vec2 %u32_1 %u32_2
+%u32vec4_0123 = OpConstantComposite %u32vec4 %u32_0 %u32_1 %u32_2 %u32_3
+%u64vec2_01 = OpConstantComposite %u64vec2 %u64_0 %u64_1
+
+%u32arr2 = OpTypeArray %u32 %u32_2
+%u32arr3 = OpTypeArray %u32 %u32_3
+%u32arr4 = OpTypeArray %u32 %u32_4
+%u64arr2 = OpTypeArray %u64 %u32_2
+%u64arr3 = OpTypeArray %u64 %u32_3
+%u64arr4 = OpTypeArray %u64 %u32_4
+%f32arr2 = OpTypeArray %f32 %u32_2
+%f32arr3 = OpTypeArray %f32 %u32_3
+%f32arr4 = OpTypeArray %f32 %u32_4
+%f64arr2 = OpTypeArray %f64 %u32_2
+%f64arr3 = OpTypeArray %f64 %u32_3
+%f64arr4 = OpTypeArray %f64 %u32_4
+
+%f32vec3arr3 = OpTypeArray %f32vec3 %u32_3
+%f32vec4arr3 = OpTypeArray %f32vec4 %u32_3
+%f64vec4arr3 = OpTypeArray %f64vec4 %u32_3
+)";
+}
+
+std::string GetWebGPUShaderTypes() {
+  return R"(
+%void = OpTypeVoid
+%func = OpTypeFunction %void
+%bool = OpTypeBool
+%f32 = OpTypeFloat 32
+%u32 = OpTypeInt 32 0
+%f32vec2 = OpTypeVector %f32 2
+%f32vec3 = OpTypeVector %f32 3
+%f32vec4 = OpTypeVector %f32 4
+%u32vec2 = OpTypeVector %u32 2
+%u32vec3 = OpTypeVector %u32 3
+%u32vec4 = OpTypeVector %u32 4
+
+%f32_0 = OpConstant %f32 0
+%f32_1 = OpConstant %f32 1
+%f32_2 = OpConstant %f32 2
+%f32_3 = OpConstant %f32 3
+%f32_4 = OpConstant %f32 4
+%f32_h = OpConstant %f32 0.5
+%f32vec2_01 = OpConstantComposite %f32vec2 %f32_0 %f32_1
+%f32vec2_12 = OpConstantComposite %f32vec2 %f32_1 %f32_2
+%f32vec3_012 = OpConstantComposite %f32vec3 %f32_0 %f32_1 %f32_2
+%f32vec3_123 = OpConstantComposite %f32vec3 %f32_1 %f32_2 %f32_3
+%f32vec4_0123 = OpConstantComposite %f32vec4 %f32_0 %f32_1 %f32_2 %f32_3
+%f32vec4_1234 = OpConstantComposite %f32vec4 %f32_1 %f32_2 %f32_3 %f32_4
+
+%u32_0 = OpConstant %u32 0
+%u32_1 = OpConstant %u32 1
+%u32_2 = OpConstant %u32 2
+%u32_3 = OpConstant %u32 3
+%u32_4 = OpConstant %u32 4
+
+%u32vec2_01 = OpConstantComposite %u32vec2 %u32_0 %u32_1
+%u32vec2_12 = OpConstantComposite %u32vec2 %u32_1 %u32_2
+%u32vec4_0123 = OpConstantComposite %u32vec4 %u32_0 %u32_1 %u32_2 %u32_3
+
+%u32arr2 = OpTypeArray %u32 %u32_2
+%u32arr3 = OpTypeArray %u32 %u32_3
+%u32arr4 = OpTypeArray %u32 %u32_4
+%f32arr2 = OpTypeArray %f32 %u32_2
+%f32arr3 = OpTypeArray %f32 %u32_3
+%f32arr4 = OpTypeArray %f32 %u32_4
+
+%f32vec3arr3 = OpTypeArray %f32vec3 %u32_3
+%f32vec4arr3 = OpTypeArray %f32vec4 %u32_3
+)";
+}
+
+}  // namespace
+
+CodeGenerator CodeGenerator::GetDefaultShaderCodeGenerator() {
+  CodeGenerator generator;
+  generator.capabilities_ = GetDefaultShaderCapabilities();
+  generator.memory_model_ = "OpMemoryModel Logical GLSL450\n";
+  generator.types_ = GetDefaultShaderTypes();
+  return generator;
+}
+
+CodeGenerator CodeGenerator::GetWebGPUShaderCodeGenerator() {
+  CodeGenerator generator;
+  generator.capabilities_ = GetWebGPUShaderCapabilities();
+  generator.memory_model_ = "OpMemoryModel Logical VulkanKHR\n";
+  generator.extensions_ = "OpExtension \"SPV_KHR_vulkan_memory_model\"\n";
+  generator.types_ = GetWebGPUShaderTypes();
+  return generator;
+}
+
+std::string CodeGenerator::Build() const {
+  std::ostringstream ss;
+
+  ss << capabilities_;
+  ss << extensions_;
+  ss << memory_model_;
+
+  for (const EntryPoint& entry_point : entry_points_) {
+    ss << "OpEntryPoint " << entry_point.execution_model << " %"
+       << entry_point.name << " \"" << entry_point.name << "\" "
+       << entry_point.interfaces << "\n";
+  }
+
+  for (const EntryPoint& entry_point : entry_points_) {
+    ss << entry_point.execution_modes << "\n";
+  }
+
+  ss << before_types_;
+  ss << types_;
+  ss << after_types_;
+
+  for (const EntryPoint& entry_point : entry_points_) {
+    ss << "\n";
+    ss << "%" << entry_point.name << " = OpFunction %void None %func\n";
+    ss << "%" << entry_point.name << "_entry = OpLabel\n";
+    ss << entry_point.body;
+    ss << "\nOpReturn\nOpFunctionEnd\n";
+  }
+
+  ss << add_at_the_end_;
+
+  return ss.str();
+}
+
+}  // namespace val
+}  // namespace spvtools

+ 49 - 0
3rdparty/spirv-tools/test/val/val_code_generator.h

@@ -0,0 +1,49 @@
+// Copyright (c) 2019 Google LLC.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Utility class used to generate SPIR-V code strings for tests
+
+#include <string>
+#include <vector>
+
+namespace spvtools {
+namespace val {
+
+struct EntryPoint {
+  std::string name;
+  std::string execution_model;
+  std::string execution_modes;
+  std::string body;
+  std::string interfaces;
+};
+
+class CodeGenerator {
+ public:
+  static CodeGenerator GetDefaultShaderCodeGenerator();
+  static CodeGenerator GetWebGPUShaderCodeGenerator();
+
+  std::string Build() const;
+
+  std::vector<EntryPoint> entry_points_;
+  std::string capabilities_;
+  std::string extensions_;
+  std::string memory_model_;
+  std::string before_types_;
+  std::string types_;
+  std::string after_types_;
+  std::string add_at_the_end_;
+};
+
+}  // namespace val
+}  // namespace spvtools

+ 5 - 5
3rdparty/spirv-tools/test/val/val_constants_test.cpp

@@ -84,7 +84,7 @@ TEST_P(ValidateConstantOp, Samples) {
   { SPV_ENV_UNIVERSAL_1_0, kShaderPreamble kBasicTypes STR, true, "" }
 #define GOOD_KERNEL_10(STR) \
   { SPV_ENV_UNIVERSAL_1_0, kKernelPreamble kBasicTypes STR, true, "" }
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     UniversalInShader, ValidateConstantOp,
     ValuesIn(std::vector<ConstantOpCase>{
         // TODO(dneto): Conversions must change width.
@@ -141,7 +141,7 @@ INSTANTIATE_TEST_CASE_P(
             "%v = OpSpecConstantOp %bool SGreaterThanEqual %uint_0 %uint_0"),
     }));
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     UniversalInKernel, ValidateConstantOp,
     ValuesIn(std::vector<ConstantOpCase>{
         // TODO(dneto): Conversions must change width.
@@ -198,7 +198,7 @@ INSTANTIATE_TEST_CASE_P(
             "%v = OpSpecConstantOp %bool SGreaterThanEqual %uint_0 %uint_0"),
     }));
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     KernelInKernel, ValidateConstantOp,
     ValuesIn(std::vector<ConstantOpCase>{
         // TODO(dneto): Conversions must change width.
@@ -235,7 +235,7 @@ INSTANTIATE_TEST_CASE_P(
         "Specialization constant operation " NAME                  \
         " requires Kernel capability"                              \
   }
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     KernelInShader, ValidateConstantOp,
     ValuesIn(std::vector<ConstantOpCase>{
         // TODO(dneto): Conversions must change width.
@@ -280,7 +280,7 @@ INSTANTIATE_TEST_CASE_P(
                       "InBoundsPtrAccessChain"),
     }));
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     UConvertInAMD_gpu_shader_int16, ValidateConstantOp,
     ValuesIn(std::vector<ConstantOpCase>{
         // SPV_AMD_gpu_shader_int16 should enable UConvert for OpSpecConstantOp

+ 328 - 4
3rdparty/spirv-tools/test/val/val_decoration_test.cpp

@@ -20,16 +20,29 @@
 #include "gmock/gmock.h"
 #include "source/val/decoration.h"
 #include "test/unit_spirv.h"
+#include "test/val/val_code_generator.h"
 #include "test/val/val_fixtures.h"
 
 namespace spvtools {
 namespace val {
 namespace {
 
+using ::testing::Combine;
 using ::testing::Eq;
 using ::testing::HasSubstr;
+using ::testing::Values;
+
+struct TestResult {
+  TestResult(spv_result_t in_validation_result = SPV_SUCCESS,
+             const std::string& in_error_str = "")
+      : validation_result(in_validation_result), error_str(in_error_str) {}
+  spv_result_t validation_result;
+  const std::string error_str;
+};
 
 using ValidateDecorations = spvtest::ValidateBase<bool>;
+using ValidateWebGPUCombineDecorationResult =
+    spvtest::ValidateBase<std::tuple<const char*, TestResult>>;
 
 TEST_F(ValidateDecorations, ValidateOpDecorateRegistration) {
   std::string spirv = R"(
@@ -115,7 +128,7 @@ TEST_F(ValidateDecorations, ValidateGroupDecorateRegistration) {
                OpCapability Linkage
                OpMemoryModel Logical GLSL450
                OpDecorate %1 DescriptorSet 0
-               OpDecorate %1 NonWritable
+               OpDecorate %1 RelaxedPrecision
                OpDecorate %1 Restrict
           %1 = OpDecorationGroup
                OpGroupDecorate %1 %2 %3
@@ -136,9 +149,10 @@ TEST_F(ValidateDecorations, ValidateGroupDecorateRegistration) {
   EXPECT_EQ(SPV_SUCCESS, ValidateAndRetrieveValidationState());
 
   // Decoration group has 3 decorations.
-  auto expected_decorations = std::vector<Decoration>{
-      Decoration(SpvDecorationDescriptorSet, {0}),
-      Decoration(SpvDecorationNonWritable), Decoration(SpvDecorationRestrict)};
+  auto expected_decorations =
+      std::vector<Decoration>{Decoration(SpvDecorationDescriptorSet, {0}),
+                              Decoration(SpvDecorationRelaxedPrecision),
+                              Decoration(SpvDecorationRestrict)};
 
   // Decoration group is applied to id 1, 2, 3, and 4. Note that id 1 (which is
   // the decoration group id) also has all the decorations.
@@ -5491,6 +5505,316 @@ OpFunctionEnd
                         "improperly straddling vector at offset 28"));
 }
 
+// NonWritable
+
+// Returns a SPIR-V shader module with variables in various storage classes,
+// parameterizable by which ID should be decorated as NonWritable.
+std::string ShaderWithNonWritableTarget(const std::string& target,
+                                        bool member_decorate = false) {
+  const std::string decoration_inst =
+      std::string(member_decorate ? "OpMemberDecorate " : "OpDecorate ") +
+      target + (member_decorate ? " 0" : "");
+
+  return std::string(R"(
+            OpCapability Shader
+            OpExtension "SPV_KHR_storage_buffer_storage_class"
+            OpMemoryModel Logical GLSL450
+            OpEntryPoint Vertex %main "main"
+            OpName %label "label"
+            OpName %param_f "param_f"
+            OpName %param_p "param_p"
+            OpName %_ptr_imstor "_ptr_imstor"
+            OpName %_ptr_imsam "_ptr_imsam"
+            OpName %var_wg "var_wg"
+            OpName %var_imsam "var_imsam"
+            OpName %var_priv "var_priv"
+            OpName %var_func "var_func"
+            OpName %struct_bad "struct_bad"
+
+            OpDecorate %struct_b Block
+            OpDecorate %struct_bb BufferBlock
+            OpDecorate %struct_b_rtarr Block
+            OpMemberDecorate %struct_b 0 Offset 0
+            OpMemberDecorate %struct_bb 0 Offset 0
+            OpMemberDecorate %struct_b_rtarr 0 Offset 0
+            OpDecorate %rtarr ArrayStride 4
+)") + decoration_inst +
+
+         R"( NonWritable
+
+      %void = OpTypeVoid
+   %void_fn = OpTypeFunction %void
+     %float = OpTypeFloat 32
+   %float_0 = OpConstant %float 0
+  %struct_b = OpTypeStruct %float
+ %struct_bb = OpTypeStruct %float
+ %rtarr = OpTypeRuntimeArray %float
+%struct_b_rtarr = OpTypeStruct %rtarr
+%struct_bad = OpTypeStruct %float
+ ; storage image
+ %imstor = OpTypeImage %float 2D 0 0 0 2 R32f
+ ; sampled image
+ %imsam = OpTypeImage %float 2D 0 0 0 1 R32f
+
+%_ptr_Uniform_stb        = OpTypePointer Uniform %struct_b
+%_ptr_Uniform_stbb       = OpTypePointer Uniform %struct_bb
+%_ptr_StorageBuffer_stb  = OpTypePointer StorageBuffer %struct_b
+%_ptr_StorageBuffer_stb_rtarr  = OpTypePointer StorageBuffer %struct_b_rtarr
+%_ptr_Workgroup          = OpTypePointer Workgroup %float
+%_ptr_Private            = OpTypePointer Private %float
+%_ptr_Function           = OpTypePointer Function %float
+%_ptr_imstor             = OpTypePointer UniformConstant %imstor
+%_ptr_imsam              = OpTypePointer UniformConstant %imsam
+
+%extra_fn = OpTypeFunction %void %float %_ptr_Private %_ptr_imstor
+
+%var_ubo = OpVariable %_ptr_Uniform_stb Uniform
+%var_ssbo_u = OpVariable %_ptr_Uniform_stbb Uniform
+%var_ssbo_sb = OpVariable %_ptr_StorageBuffer_stb StorageBuffer
+%var_ssbo_sb_rtarr = OpVariable %_ptr_StorageBuffer_stb_rtarr StorageBuffer
+%var_wg = OpVariable %_ptr_Workgroup Workgroup
+%var_priv = OpVariable %_ptr_Private Private
+%var_imstor = OpVariable %_ptr_imstor UniformConstant
+%var_imsam = OpVariable %_ptr_imsam UniformConstant
+
+  %helper = OpFunction %void None %extra_fn
+ %param_f = OpFunctionParameter %float
+ %param_p = OpFunctionParameter %_ptr_Private
+ %param_pimstor = OpFunctionParameter %_ptr_imstor
+%helper_label = OpLabel
+%helper_func_var = OpVariable %_ptr_Function Function
+            OpReturn
+            OpFunctionEnd
+
+    %main = OpFunction %void None %void_fn
+   %label = OpLabel
+%var_func = OpVariable %_ptr_Function Function
+            OpReturn
+            OpFunctionEnd
+)";
+}
+
+TEST_F(ValidateDecorations, NonWritableLabelTargetBad) {
+  std::string spirv = ShaderWithNonWritableTarget("%label");
+
+  CompileSuccessfully(spirv);
+  EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
+  EXPECT_THAT(getDiagnosticString(),
+              HasSubstr("Target of NonWritable decoration must be a "
+                        "memory object declaration (a variable or a function "
+                        "parameter)\n  %label = OpLabel"));
+}
+
+TEST_F(ValidateDecorations, NonWritableTypeTargetBad) {
+  std::string spirv = ShaderWithNonWritableTarget("%void");
+
+  CompileSuccessfully(spirv);
+  EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
+  EXPECT_THAT(getDiagnosticString(),
+              HasSubstr("Target of NonWritable decoration must be a "
+                        "memory object declaration (a variable or a function "
+                        "parameter)\n  %void = OpTypeVoid"));
+}
+
+TEST_F(ValidateDecorations, NonWritableValueTargetBad) {
+  std::string spirv = ShaderWithNonWritableTarget("%float_0");
+
+  CompileSuccessfully(spirv);
+  EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
+  EXPECT_THAT(getDiagnosticString(),
+              HasSubstr("Target of NonWritable decoration must be a "
+                        "memory object declaration (a variable or a function "
+                        "parameter)\n  %float_0 = OpConstant %float 0"));
+}
+
+TEST_F(ValidateDecorations, NonWritableValueParamBad) {
+  std::string spirv = ShaderWithNonWritableTarget("%param_f");
+
+  CompileSuccessfully(spirv);
+  EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
+  EXPECT_THAT(getDiagnosticString(),
+              HasSubstr("Target of NonWritable decoration is invalid: must "
+                        "point to a storage image, uniform block, or storage "
+                        "buffer\n  %param_f = OpFunctionParameter %float"));
+}
+
+TEST_F(ValidateDecorations, NonWritablePointerParamButWrongTypeBad) {
+  std::string spirv = ShaderWithNonWritableTarget("%param_p");
+
+  CompileSuccessfully(spirv);
+  EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
+  EXPECT_THAT(
+      getDiagnosticString(),
+      HasSubstr(
+          "Target of NonWritable decoration is invalid: must "
+          "point to a storage image, uniform block, or storage "
+          "buffer\n  %param_p = OpFunctionParameter %_ptr_Private_float"));
+}
+
+TEST_F(ValidateDecorations, NonWritablePointerParamStorageImageGood) {
+  std::string spirv = ShaderWithNonWritableTarget("%param_pimstor");
+
+  CompileSuccessfully(spirv);
+  EXPECT_EQ(SPV_SUCCESS, ValidateInstructions());
+  EXPECT_THAT(getDiagnosticString(), Eq(""));
+}
+
+TEST_F(ValidateDecorations, NonWritableVarStorageImageGood) {
+  std::string spirv = ShaderWithNonWritableTarget("%var_imstor");
+
+  CompileSuccessfully(spirv);
+  EXPECT_EQ(SPV_SUCCESS, ValidateInstructions());
+  EXPECT_THAT(getDiagnosticString(), Eq(""));
+}
+
+TEST_F(ValidateDecorations, NonWritableVarSampledImageBad) {
+  std::string spirv = ShaderWithNonWritableTarget("%var_imsam");
+
+  CompileSuccessfully(spirv);
+  EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
+  EXPECT_THAT(getDiagnosticString(),
+              HasSubstr("Target of NonWritable decoration is invalid: must "
+                        "point to a storage image, uniform block, or storage "
+                        "buffer\n  %var_imsam"));
+}
+
+TEST_F(ValidateDecorations, NonWritableVarUboGood) {
+  std::string spirv = ShaderWithNonWritableTarget("%var_ubo");
+
+  CompileSuccessfully(spirv);
+  EXPECT_EQ(SPV_SUCCESS, ValidateInstructions());
+  EXPECT_THAT(getDiagnosticString(), Eq(""));
+}
+
+TEST_F(ValidateDecorations, NonWritableVarSsboInUniformGood) {
+  std::string spirv = ShaderWithNonWritableTarget("%var_ssbo_u");
+
+  CompileSuccessfully(spirv);
+  EXPECT_EQ(SPV_SUCCESS, ValidateInstructions());
+  EXPECT_THAT(getDiagnosticString(), Eq(""));
+}
+
+TEST_F(ValidateDecorations, NonWritableVarSsboInStorageBufferGood) {
+  std::string spirv = ShaderWithNonWritableTarget("%var_ssbo_sb");
+
+  CompileSuccessfully(spirv);
+  EXPECT_EQ(SPV_SUCCESS, ValidateInstructions());
+  EXPECT_THAT(getDiagnosticString(), Eq(""));
+}
+
+TEST_F(ValidateDecorations, NonWritableMemberOfSsboInStorageBufferGood) {
+  std::string spirv = ShaderWithNonWritableTarget("%struct_b_rtarr", true);
+
+  CompileSuccessfully(spirv);
+  EXPECT_EQ(SPV_SUCCESS, ValidateInstructions());
+  EXPECT_THAT(getDiagnosticString(), Eq(""));
+}
+
+TEST_F(ValidateDecorations, NonWritableMemberOfNonBlockStructBad) {
+  std::string spirv = ShaderWithNonWritableTarget("%struct_bad", true);
+
+  CompileSuccessfully(spirv);
+  EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
+  EXPECT_THAT(
+      getDiagnosticString(),
+      HasSubstr("Target of NonWritable member decoration is invalid: must be "
+                "the struct type of a uniform block or storage buffer"));
+}
+
+TEST_F(ValidateDecorations, NonWritableVarWorkgroupBad) {
+  std::string spirv = ShaderWithNonWritableTarget("%var_wg");
+
+  CompileSuccessfully(spirv);
+  EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
+  EXPECT_THAT(getDiagnosticString(),
+              HasSubstr("Target of NonWritable decoration is invalid: must "
+                        "point to a storage image, uniform block, or storage "
+                        "buffer\n  %var_wg"));
+}
+
+TEST_F(ValidateDecorations, NonWritableVarPrivateBad) {
+  std::string spirv = ShaderWithNonWritableTarget("%var_priv");
+
+  CompileSuccessfully(spirv);
+  EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
+  EXPECT_THAT(getDiagnosticString(),
+              HasSubstr("Target of NonWritable decoration is invalid: must "
+                        "point to a storage image, uniform block, or storage "
+                        "buffer\n  %var_priv"));
+}
+
+TEST_F(ValidateDecorations, NonWritableVarFunctionBad) {
+  std::string spirv = ShaderWithNonWritableTarget("%var_func");
+
+  CompileSuccessfully(spirv);
+  EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
+  EXPECT_THAT(getDiagnosticString(),
+              HasSubstr("Target of NonWritable decoration is invalid: must "
+                        "point to a storage image, uniform block, or storage "
+                        "buffer\n  %var_func"));
+}
+
+TEST_P(ValidateWebGPUCombineDecorationResult, Decorate) {
+  const char* const decoration = std::get<0>(GetParam());
+  const TestResult& test_result = std::get<1>(GetParam());
+
+  CodeGenerator generator = CodeGenerator::GetWebGPUShaderCodeGenerator();
+  generator.before_types_ = "OpDecorate %u32 ";
+  generator.before_types_ += decoration;
+  generator.before_types_ += "\n";
+
+  EntryPoint entry_point;
+  entry_point.name = "main";
+  entry_point.execution_model = "Vertex";
+  generator.entry_points_.push_back(std::move(entry_point));
+
+  CompileSuccessfully(generator.Build(), SPV_ENV_WEBGPU_0);
+  ASSERT_EQ(test_result.validation_result,
+            ValidateInstructions(SPV_ENV_WEBGPU_0));
+  if (test_result.error_str != "") {
+    EXPECT_THAT(getDiagnosticString(), HasSubstr(test_result.error_str));
+  }
+}
+
+TEST_P(ValidateWebGPUCombineDecorationResult, DecorateMember) {
+  const char* const decoration = std::get<0>(GetParam());
+  const TestResult& test_result = std::get<1>(GetParam());
+
+  CodeGenerator generator = CodeGenerator::GetWebGPUShaderCodeGenerator();
+  generator.before_types_ = "OpMemberDecorate %struct_type 0 ";
+  generator.before_types_ += decoration;
+  generator.before_types_ += "\n";
+
+  generator.after_types_ = "%struct_type = OpTypeStruct %u32\n";
+
+  EntryPoint entry_point;
+  entry_point.name = "main";
+  entry_point.execution_model = "Vertex";
+  generator.entry_points_.push_back(std::move(entry_point));
+
+  CompileSuccessfully(generator.Build(), SPV_ENV_WEBGPU_0);
+  ASSERT_EQ(test_result.validation_result,
+            ValidateInstructions(SPV_ENV_WEBGPU_0));
+  if (!test_result.error_str.empty()) {
+    EXPECT_THAT(getDiagnosticString(), HasSubstr(test_result.error_str));
+  }
+}
+
+INSTANTIATE_TEST_SUITE_P(
+    DecorationCapabilityFailure, ValidateWebGPUCombineDecorationResult,
+    Combine(Values("CPacked", "Patch", "Sample", "Constant",
+                   "SaturatedConversion", "NonUniformEXT"),
+            Values(TestResult(SPV_ERROR_INVALID_CAPABILITY,
+                              "requires one of these capabilities"))));
+
+INSTANTIATE_TEST_SUITE_P(
+    DecorationWhitelistFailure, ValidateWebGPUCombineDecorationResult,
+    Combine(Values("RelaxedPrecision", "BufferBlock", "GLSLShared",
+                   "GLSLPacked", "Invariant", "Volatile", "Coherent"),
+            Values(TestResult(
+                SPV_ERROR_INVALID_ID,
+                "is not valid for the WebGPU execution environment."))));
+
 }  // namespace
 }  // namespace val
 }  // namespace spvtools

+ 212 - 212
3rdparty/spirv-tools/test/val/val_ext_inst_test.cpp

@@ -493,20 +493,20 @@ TEST_P(ValidateGlslStd450SqrtLike, IntOperand) {
                         "Result Type"));
 }
 
-INSTANTIATE_TEST_CASE_P(AllSqrtLike, ValidateGlslStd450SqrtLike,
-                        ::testing::ValuesIn(std::vector<std::string>{
-                            "Round",
-                            "RoundEven",
-                            "FAbs",
-                            "Trunc",
-                            "FSign",
-                            "Floor",
-                            "Ceil",
-                            "Fract",
-                            "Sqrt",
-                            "InverseSqrt",
-                            "Normalize",
-                        }), );
+INSTANTIATE_TEST_SUITE_P(AllSqrtLike, ValidateGlslStd450SqrtLike,
+                         ::testing::ValuesIn(std::vector<std::string>{
+                             "Round",
+                             "RoundEven",
+                             "FAbs",
+                             "Trunc",
+                             "FSign",
+                             "Floor",
+                             "Ceil",
+                             "Fract",
+                             "Sqrt",
+                             "InverseSqrt",
+                             "Normalize",
+                         }));
 
 TEST_P(ValidateGlslStd450FMinLike, Success) {
   const std::string ext_inst_name = GetParam();
@@ -560,15 +560,15 @@ TEST_P(ValidateGlslStd450FMinLike, IntOperand2) {
                         "Result Type"));
 }
 
-INSTANTIATE_TEST_CASE_P(AllFMinLike, ValidateGlslStd450FMinLike,
-                        ::testing::ValuesIn(std::vector<std::string>{
-                            "FMin",
-                            "FMax",
-                            "Step",
-                            "Reflect",
-                            "NMin",
-                            "NMax",
-                        }), );
+INSTANTIATE_TEST_SUITE_P(AllFMinLike, ValidateGlslStd450FMinLike,
+                         ::testing::ValuesIn(std::vector<std::string>{
+                             "FMin",
+                             "FMax",
+                             "Step",
+                             "Reflect",
+                             "NMin",
+                             "NMax",
+                         }));
 
 TEST_P(ValidateGlslStd450FClampLike, Success) {
   const std::string ext_inst_name = GetParam();
@@ -635,15 +635,15 @@ TEST_P(ValidateGlslStd450FClampLike, IntOperand3) {
                         "Result Type"));
 }
 
-INSTANTIATE_TEST_CASE_P(AllFClampLike, ValidateGlslStd450FClampLike,
-                        ::testing::ValuesIn(std::vector<std::string>{
-                            "FClamp",
-                            "FMix",
-                            "SmoothStep",
-                            "Fma",
-                            "FaceForward",
-                            "NClamp",
-                        }), );
+INSTANTIATE_TEST_SUITE_P(AllFClampLike, ValidateGlslStd450FClampLike,
+                         ::testing::ValuesIn(std::vector<std::string>{
+                             "FClamp",
+                             "FMix",
+                             "SmoothStep",
+                             "Fma",
+                             "FaceForward",
+                             "NClamp",
+                         }));
 
 TEST_P(ValidateGlslStd450SAbsLike, Success) {
   const std::string ext_inst_name = GetParam();
@@ -716,14 +716,14 @@ TEST_P(ValidateGlslStd450SAbsLike, WrongBitWidthOperand) {
                         "Result Type"));
 }
 
-INSTANTIATE_TEST_CASE_P(AllSAbsLike, ValidateGlslStd450SAbsLike,
-                        ::testing::ValuesIn(std::vector<std::string>{
-                            "SAbs",
-                            "SSign",
-                            "FindILsb",
-                            "FindUMsb",
-                            "FindSMsb",
-                        }), );
+INSTANTIATE_TEST_SUITE_P(AllSAbsLike, ValidateGlslStd450SAbsLike,
+                         ::testing::ValuesIn(std::vector<std::string>{
+                             "SAbs",
+                             "SSign",
+                             "FindILsb",
+                             "FindUMsb",
+                             "FindSMsb",
+                         }));
 
 TEST_F(ValidateExtInst, FindUMsbNot32Bit) {
   const std::string body = R"(
@@ -865,13 +865,13 @@ TEST_P(ValidateGlslStd450UMinLike, WrongBitWidthOperand2) {
                         "Result Type"));
 }
 
-INSTANTIATE_TEST_CASE_P(AllUMinLike, ValidateGlslStd450UMinLike,
-                        ::testing::ValuesIn(std::vector<std::string>{
-                            "UMin",
-                            "SMin",
-                            "UMax",
-                            "SMax",
-                        }), );
+INSTANTIATE_TEST_SUITE_P(AllUMinLike, ValidateGlslStd450UMinLike,
+                         ::testing::ValuesIn(std::vector<std::string>{
+                             "UMin",
+                             "SMin",
+                             "UMax",
+                             "SMax",
+                         }));
 
 TEST_P(ValidateGlslStd450UClampLike, Success) {
   const std::string ext_inst_name = GetParam();
@@ -1028,11 +1028,11 @@ TEST_P(ValidateGlslStd450UClampLike, WrongBitWidthOperand3) {
                         "Result Type"));
 }
 
-INSTANTIATE_TEST_CASE_P(AllUClampLike, ValidateGlslStd450UClampLike,
-                        ::testing::ValuesIn(std::vector<std::string>{
-                            "UClamp",
-                            "SClamp",
-                        }), );
+INSTANTIATE_TEST_SUITE_P(AllUClampLike, ValidateGlslStd450UClampLike,
+                         ::testing::ValuesIn(std::vector<std::string>{
+                             "UClamp",
+                             "SClamp",
+                         }));
 
 TEST_P(ValidateGlslStd450SinLike, Success) {
   const std::string ext_inst_name = GetParam();
@@ -1083,27 +1083,27 @@ TEST_P(ValidateGlslStd450SinLike, IntOperand) {
                         "Result Type"));
 }
 
-INSTANTIATE_TEST_CASE_P(AllSinLike, ValidateGlslStd450SinLike,
-                        ::testing::ValuesIn(std::vector<std::string>{
-                            "Radians",
-                            "Degrees",
-                            "Sin",
-                            "Cos",
-                            "Tan",
-                            "Asin",
-                            "Acos",
-                            "Atan",
-                            "Sinh",
-                            "Cosh",
-                            "Tanh",
-                            "Asinh",
-                            "Acosh",
-                            "Atanh",
-                            "Exp",
-                            "Exp2",
-                            "Log",
-                            "Log2",
-                        }), );
+INSTANTIATE_TEST_SUITE_P(AllSinLike, ValidateGlslStd450SinLike,
+                         ::testing::ValuesIn(std::vector<std::string>{
+                             "Radians",
+                             "Degrees",
+                             "Sin",
+                             "Cos",
+                             "Tan",
+                             "Asin",
+                             "Acos",
+                             "Atan",
+                             "Sinh",
+                             "Cosh",
+                             "Tanh",
+                             "Asinh",
+                             "Acosh",
+                             "Atanh",
+                             "Exp",
+                             "Exp2",
+                             "Log",
+                             "Log2",
+                         }));
 
 TEST_P(ValidateGlslStd450PowLike, Success) {
   const std::string ext_inst_name = GetParam();
@@ -1168,11 +1168,11 @@ TEST_P(ValidateGlslStd450PowLike, IntOperand2) {
                         "Result Type"));
 }
 
-INSTANTIATE_TEST_CASE_P(AllPowLike, ValidateGlslStd450PowLike,
-                        ::testing::ValuesIn(std::vector<std::string>{
-                            "Atan2",
-                            "Pow",
-                        }), );
+INSTANTIATE_TEST_SUITE_P(AllPowLike, ValidateGlslStd450PowLike,
+                         ::testing::ValuesIn(std::vector<std::string>{
+                             "Atan2",
+                             "Pow",
+                         }));
 
 TEST_F(ValidateExtInst, GlslStd450DeterminantSuccess) {
   const std::string body = R"(
@@ -1795,14 +1795,14 @@ TEST_P(ValidateGlslStd450Pack, VWrongSizeVector) {
   EXPECT_THAT(getDiagnosticString(), HasSubstr(expected.str()));
 }
 
-INSTANTIATE_TEST_CASE_P(AllPack, ValidateGlslStd450Pack,
-                        ::testing::ValuesIn(std::vector<std::string>{
-                            "PackSnorm4x8",
-                            "PackUnorm4x8",
-                            "PackSnorm2x16",
-                            "PackUnorm2x16",
-                            "PackHalf2x16",
-                        }), );
+INSTANTIATE_TEST_SUITE_P(AllPack, ValidateGlslStd450Pack,
+                         ::testing::ValuesIn(std::vector<std::string>{
+                             "PackSnorm4x8",
+                             "PackUnorm4x8",
+                             "PackSnorm2x16",
+                             "PackUnorm2x16",
+                             "PackHalf2x16",
+                         }));
 
 TEST_F(ValidateExtInst, PackDouble2x32Success) {
   const std::string body = R"(
@@ -2034,14 +2034,14 @@ TEST_P(ValidateGlslStd450Unpack, ResultPWrongBitWidth) {
   EXPECT_THAT(getDiagnosticString(), HasSubstr(expected.str()));
 }
 
-INSTANTIATE_TEST_CASE_P(AllUnpack, ValidateGlslStd450Unpack,
-                        ::testing::ValuesIn(std::vector<std::string>{
-                            "UnpackSnorm4x8",
-                            "UnpackUnorm4x8",
-                            "UnpackSnorm2x16",
-                            "UnpackUnorm2x16",
-                            "UnpackHalf2x16",
-                        }), );
+INSTANTIATE_TEST_SUITE_P(AllUnpack, ValidateGlslStd450Unpack,
+                         ::testing::ValuesIn(std::vector<std::string>{
+                             "UnpackSnorm4x8",
+                             "UnpackUnorm4x8",
+                             "UnpackSnorm2x16",
+                             "UnpackUnorm2x16",
+                             "UnpackHalf2x16",
+                         }));
 
 TEST_F(ValidateExtInst, UnpackDouble2x32Success) {
   const std::string body = R"(
@@ -2831,7 +2831,7 @@ TEST_P(ValidateOpenCLStdSqrtLike, IntOperand) {
                         "Result Type"));
 }
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     AllSqrtLike, ValidateOpenCLStdSqrtLike,
     ::testing::ValuesIn(std::vector<std::string>{
         "acos",         "acosh",       "acospi",       "asin",
@@ -2851,7 +2851,7 @@ INSTANTIATE_TEST_CASE_P(
         "native_log",   "native_log2", "native_log10", "native_recip",
         "native_rsqrt", "native_sin",  "native_sqrt",  "native_tan",
         "degrees",      "radians",     "sign",
-    }), );
+    }));
 
 TEST_P(ValidateOpenCLStdFMinLike, Success) {
   const std::string ext_inst_name = GetParam();
@@ -2905,16 +2905,16 @@ TEST_P(ValidateOpenCLStdFMinLike, IntOperand2) {
                         "Result Type"));
 }
 
-INSTANTIATE_TEST_CASE_P(AllFMinLike, ValidateOpenCLStdFMinLike,
-                        ::testing::ValuesIn(std::vector<std::string>{
-                            "atan2",     "atan2pi",       "copysign",
-                            "fdim",      "fmax",          "fmin",
-                            "fmod",      "maxmag",        "minmag",
-                            "hypot",     "nextafter",     "pow",
-                            "powr",      "remainder",     "half_divide",
-                            "half_powr", "native_divide", "native_powr",
-                            "step",      "fmax_common",   "fmin_common",
-                        }), );
+INSTANTIATE_TEST_SUITE_P(AllFMinLike, ValidateOpenCLStdFMinLike,
+                         ::testing::ValuesIn(std::vector<std::string>{
+                             "atan2",     "atan2pi",       "copysign",
+                             "fdim",      "fmax",          "fmin",
+                             "fmod",      "maxmag",        "minmag",
+                             "hypot",     "nextafter",     "pow",
+                             "powr",      "remainder",     "half_divide",
+                             "half_powr", "native_divide", "native_powr",
+                             "step",      "fmax_common",   "fmin_common",
+                         }));
 
 TEST_P(ValidateOpenCLStdFClampLike, Success) {
   const std::string ext_inst_name = GetParam();
@@ -2981,14 +2981,14 @@ TEST_P(ValidateOpenCLStdFClampLike, IntOperand3) {
                         "Result Type"));
 }
 
-INSTANTIATE_TEST_CASE_P(AllFClampLike, ValidateOpenCLStdFClampLike,
-                        ::testing::ValuesIn(std::vector<std::string>{
-                            "fma",
-                            "mad",
-                            "fclamp",
-                            "mix",
-                            "smoothstep",
-                        }), );
+INSTANTIATE_TEST_SUITE_P(AllFClampLike, ValidateOpenCLStdFClampLike,
+                         ::testing::ValuesIn(std::vector<std::string>{
+                             "fma",
+                             "mad",
+                             "fclamp",
+                             "mix",
+                             "smoothstep",
+                         }));
 
 TEST_P(ValidateOpenCLStdSAbsLike, Success) {
   const std::string ext_inst_name = GetParam();
@@ -3048,14 +3048,14 @@ TEST_P(ValidateOpenCLStdSAbsLike, U64Operand) {
                 ": expected types of all operands to be equal to Result Type"));
 }
 
-INSTANTIATE_TEST_CASE_P(AllSAbsLike, ValidateOpenCLStdSAbsLike,
-                        ::testing::ValuesIn(std::vector<std::string>{
-                            "s_abs",
-                            "clz",
-                            "ctz",
-                            "popcount",
-                            "u_abs",
-                        }), );
+INSTANTIATE_TEST_SUITE_P(AllSAbsLike, ValidateOpenCLStdSAbsLike,
+                         ::testing::ValuesIn(std::vector<std::string>{
+                             "s_abs",
+                             "clz",
+                             "ctz",
+                             "popcount",
+                             "u_abs",
+                         }));
 
 TEST_P(ValidateOpenCLStdUMinLike, Success) {
   const std::string ext_inst_name = GetParam();
@@ -3147,26 +3147,26 @@ TEST_P(ValidateOpenCLStdUMinLike, U64Operand2) {
                 ": expected types of all operands to be equal to Result Type"));
 }
 
-INSTANTIATE_TEST_CASE_P(AllUMinLike, ValidateOpenCLStdUMinLike,
-                        ::testing::ValuesIn(std::vector<std::string>{
-                            "s_max",
-                            "u_max",
-                            "s_min",
-                            "u_min",
-                            "s_abs_diff",
-                            "s_add_sat",
-                            "u_add_sat",
-                            "s_mul_hi",
-                            "rotate",
-                            "s_sub_sat",
-                            "u_sub_sat",
-                            "s_hadd",
-                            "u_hadd",
-                            "s_rhadd",
-                            "u_rhadd",
-                            "u_abs_diff",
-                            "u_mul_hi",
-                        }), );
+INSTANTIATE_TEST_SUITE_P(AllUMinLike, ValidateOpenCLStdUMinLike,
+                         ::testing::ValuesIn(std::vector<std::string>{
+                             "s_max",
+                             "u_max",
+                             "s_min",
+                             "u_min",
+                             "s_abs_diff",
+                             "s_add_sat",
+                             "u_add_sat",
+                             "s_mul_hi",
+                             "rotate",
+                             "s_sub_sat",
+                             "u_sub_sat",
+                             "s_hadd",
+                             "u_hadd",
+                             "s_rhadd",
+                             "u_rhadd",
+                             "u_abs_diff",
+                             "u_mul_hi",
+                         }));
 
 TEST_P(ValidateOpenCLStdUClampLike, Success) {
   const std::string ext_inst_name = GetParam();
@@ -3284,15 +3284,15 @@ TEST_P(ValidateOpenCLStdUClampLike, U64Operand3) {
                 ": expected types of all operands to be equal to Result Type"));
 }
 
-INSTANTIATE_TEST_CASE_P(AllUClampLike, ValidateOpenCLStdUClampLike,
-                        ::testing::ValuesIn(std::vector<std::string>{
-                            "s_clamp",
-                            "u_clamp",
-                            "s_mad_hi",
-                            "u_mad_sat",
-                            "s_mad_sat",
-                            "u_mad_hi",
-                        }), );
+INSTANTIATE_TEST_SUITE_P(AllUClampLike, ValidateOpenCLStdUClampLike,
+                         ::testing::ValuesIn(std::vector<std::string>{
+                             "s_clamp",
+                             "u_clamp",
+                             "s_mad_hi",
+                             "u_mad_sat",
+                             "s_mad_sat",
+                             "u_mad_hi",
+                         }));
 
 // -------------------------------------------------------------
 TEST_P(ValidateOpenCLStdUMul24Like, Success) {
@@ -3398,11 +3398,11 @@ TEST_P(ValidateOpenCLStdUMul24Like, U64Operand2) {
                 ": expected types of all operands to be equal to Result Type"));
 }
 
-INSTANTIATE_TEST_CASE_P(AllUMul24Like, ValidateOpenCLStdUMul24Like,
-                        ::testing::ValuesIn(std::vector<std::string>{
-                            "s_mul24",
-                            "u_mul24",
-                        }), );
+INSTANTIATE_TEST_SUITE_P(AllUMul24Like, ValidateOpenCLStdUMul24Like,
+                         ::testing::ValuesIn(std::vector<std::string>{
+                             "s_mul24",
+                             "u_mul24",
+                         }));
 
 TEST_P(ValidateOpenCLStdUMad24Like, Success) {
   const std::string ext_inst_name = GetParam();
@@ -3533,11 +3533,11 @@ TEST_P(ValidateOpenCLStdUMad24Like, U64Operand3) {
                 ": expected types of all operands to be equal to Result Type"));
 }
 
-INSTANTIATE_TEST_CASE_P(AllUMad24Like, ValidateOpenCLStdUMad24Like,
-                        ::testing::ValuesIn(std::vector<std::string>{
-                            "s_mad24",
-                            "u_mad24",
-                        }), );
+INSTANTIATE_TEST_SUITE_P(AllUMad24Like, ValidateOpenCLStdUMad24Like,
+                         ::testing::ValuesIn(std::vector<std::string>{
+                             "s_mad24",
+                             "u_mad24",
+                         }));
 
 TEST_F(ValidateExtInst, OpenCLStdCrossSuccess) {
   const std::string body = R"(
@@ -3662,11 +3662,11 @@ TEST_P(ValidateOpenCLStdLengthLike, DifferentType) {
                         "Result Type"));
 }
 
-INSTANTIATE_TEST_CASE_P(AllLengthLike, ValidateOpenCLStdLengthLike,
-                        ::testing::ValuesIn(std::vector<std::string>{
-                            "length",
-                            "fast_length",
-                        }), );
+INSTANTIATE_TEST_SUITE_P(AllLengthLike, ValidateOpenCLStdLengthLike,
+                         ::testing::ValuesIn(std::vector<std::string>{
+                             "length",
+                             "fast_length",
+                         }));
 
 TEST_P(ValidateOpenCLStdDistanceLike, Success) {
   const std::string ext_inst_name = GetParam();
@@ -3751,11 +3751,11 @@ TEST_P(ValidateOpenCLStdDistanceLike, DifferentOperands) {
                         "expected operands P0 and P1 to be of the same type"));
 }
 
-INSTANTIATE_TEST_CASE_P(AllDistanceLike, ValidateOpenCLStdDistanceLike,
-                        ::testing::ValuesIn(std::vector<std::string>{
-                            "distance",
-                            "fast_distance",
-                        }), );
+INSTANTIATE_TEST_SUITE_P(AllDistanceLike, ValidateOpenCLStdDistanceLike,
+                         ::testing::ValuesIn(std::vector<std::string>{
+                             "distance",
+                             "fast_distance",
+                         }));
 
 TEST_P(ValidateOpenCLStdNormalizeLike, Success) {
   const std::string ext_inst_name = GetParam();
@@ -3811,11 +3811,11 @@ TEST_P(ValidateOpenCLStdNormalizeLike, DifferentType) {
                         "expected operand P type to be equal to Result Type"));
 }
 
-INSTANTIATE_TEST_CASE_P(AllNormalizeLike, ValidateOpenCLStdNormalizeLike,
-                        ::testing::ValuesIn(std::vector<std::string>{
-                            "normalize",
-                            "fast_normalize",
-                        }), );
+INSTANTIATE_TEST_SUITE_P(AllNormalizeLike, ValidateOpenCLStdNormalizeLike,
+                         ::testing::ValuesIn(std::vector<std::string>{
+                             "normalize",
+                             "fast_normalize",
+                         }));
 
 TEST_F(ValidateExtInst, OpenCLStdBitselectSuccess) {
   const std::string body = R"(
@@ -4208,15 +4208,15 @@ TEST_P(ValidateOpenCLStdVStoreHalfLike, PDataTypeFloat32) {
                 ": expected operand P data type to be 16-bit float scalar"));
 }
 
-INSTANTIATE_TEST_CASE_P(AllVStoreHalfLike, ValidateOpenCLStdVStoreHalfLike,
-                        ::testing::ValuesIn(std::vector<std::string>{
-                            "vstore_half",
-                            "vstore_half_r",
-                            "vstore_halfn",
-                            "vstore_halfn_r",
-                            "vstorea_halfn",
-                            "vstorea_halfn_r",
-                        }), );
+INSTANTIATE_TEST_SUITE_P(AllVStoreHalfLike, ValidateOpenCLStdVStoreHalfLike,
+                         ::testing::ValuesIn(std::vector<std::string>{
+                             "vstore_half",
+                             "vstore_half_r",
+                             "vstore_halfn",
+                             "vstore_halfn_r",
+                             "vstorea_halfn",
+                             "vstorea_halfn_r",
+                         }));
 
 TEST_P(ValidateOpenCLStdVLoadHalfLike, SuccessPhysical32) {
   const std::string ext_inst_name = GetParam();
@@ -4375,11 +4375,11 @@ TEST_P(ValidateOpenCLStdVLoadHalfLike, WrongN) {
                         "components of Result Type"));
 }
 
-INSTANTIATE_TEST_CASE_P(AllVLoadHalfLike, ValidateOpenCLStdVLoadHalfLike,
-                        ::testing::ValuesIn(std::vector<std::string>{
-                            "vload_halfn",
-                            "vloada_halfn",
-                        }), );
+INSTANTIATE_TEST_SUITE_P(AllVLoadHalfLike, ValidateOpenCLStdVLoadHalfLike,
+                         ::testing::ValuesIn(std::vector<std::string>{
+                             "vload_halfn",
+                             "vloada_halfn",
+                         }));
 
 TEST_F(ValidateExtInst, VLoadNSuccessFloatPhysical32) {
   std::ostringstream ss;
@@ -5299,12 +5299,12 @@ TEST_P(ValidateOpenCLStdFractLike, PointerWrongDataType) {
           ": expected data type of the pointer to be equal to Result Type"));
 }
 
-INSTANTIATE_TEST_CASE_P(AllFractLike, ValidateOpenCLStdFractLike,
-                        ::testing::ValuesIn(std::vector<std::string>{
-                            "fract",
-                            "modf",
-                            "sincos",
-                        }), );
+INSTANTIATE_TEST_SUITE_P(AllFractLike, ValidateOpenCLStdFractLike,
+                         ::testing::ValuesIn(std::vector<std::string>{
+                             "fract",
+                             "modf",
+                             "sincos",
+                         }));
 
 TEST_F(ValidateExtInst, OpenCLStdRemquoSuccess) {
   const std::string body = R"(
@@ -5518,11 +5518,11 @@ TEST_P(ValidateOpenCLStdFrexpLike, PointerDataTypeDiffSize) {
                         "number of components as Result Type"));
 }
 
-INSTANTIATE_TEST_CASE_P(AllFrexpLike, ValidateOpenCLStdFrexpLike,
-                        ::testing::ValuesIn(std::vector<std::string>{
-                            "frexp",
-                            "lgamma_r",
-                        }), );
+INSTANTIATE_TEST_SUITE_P(AllFrexpLike, ValidateOpenCLStdFrexpLike,
+                         ::testing::ValuesIn(std::vector<std::string>{
+                             "frexp",
+                             "lgamma_r",
+                         }));
 
 TEST_F(ValidateExtInst, OpenCLStdIlogbSuccess) {
   const std::string body = R"(
@@ -5716,12 +5716,12 @@ TEST_P(ValidateOpenCLStdLdexpLike, ExponentWrongSize) {
                         "components as Result Type"));
 }
 
-INSTANTIATE_TEST_CASE_P(AllLdexpLike, ValidateOpenCLStdLdexpLike,
-                        ::testing::ValuesIn(std::vector<std::string>{
-                            "ldexp",
-                            "pown",
-                            "rootn",
-                        }), );
+INSTANTIATE_TEST_SUITE_P(AllLdexpLike, ValidateOpenCLStdLdexpLike,
+                         ::testing::ValuesIn(std::vector<std::string>{
+                             "ldexp",
+                             "pown",
+                             "rootn",
+                         }));
 
 TEST_P(ValidateOpenCLStdUpsampleLike, Success) {
   const std::string ext_inst_name = GetParam();
@@ -5808,11 +5808,11 @@ TEST_P(ValidateOpenCLStdUpsampleLike, HiLoWrongBitWidth) {
                 "be half of the bit width of components of Result Type"));
 }
 
-INSTANTIATE_TEST_CASE_P(AllUpsampleLike, ValidateOpenCLStdUpsampleLike,
-                        ::testing::ValuesIn(std::vector<std::string>{
-                            "u_upsample",
-                            "s_upsample",
-                        }), );
+INSTANTIATE_TEST_SUITE_P(AllUpsampleLike, ValidateOpenCLStdUpsampleLike,
+                         ::testing::ValuesIn(std::vector<std::string>{
+                             "u_upsample",
+                             "s_upsample",
+                         }));
 
 }  // namespace
 }  // namespace val

+ 9 - 9
3rdparty/spirv-tools/test/val/val_extensions_test.cpp

@@ -43,7 +43,7 @@ std::string GetErrorString(const std::string& extension) {
   return "Found unrecognized extension " + extension;
 }
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     ExpectSuccess, ValidateKnownExtensions,
     Values(
         // Match the order as published on the SPIR-V Registry.
@@ -64,9 +64,9 @@ INSTANTIATE_TEST_CASE_P(
         "SPV_GOOGLE_decorate_string", "SPV_GOOGLE_hlsl_functionality1",
         "SPV_NV_shader_subgroup_partitioned", "SPV_EXT_descriptor_indexing"));
 
-INSTANTIATE_TEST_CASE_P(FailSilently, ValidateUnknownExtensions,
-                        Values("ERROR_unknown_extension", "SPV_KHR_",
-                               "SPV_KHR_shader_ballot_ERROR"));
+INSTANTIATE_TEST_SUITE_P(FailSilently, ValidateUnknownExtensions,
+                         Values("ERROR_unknown_extension", "SPV_KHR_",
+                                "SPV_KHR_shader_ballot_ERROR"));
 
 TEST_P(ValidateKnownExtensions, ExpectSuccess) {
   const std::string extension = GetParam();
@@ -227,8 +227,8 @@ TEST_P(ValidateAMDShaderBallotCapabilities, ExpectSuccess) {
   EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()) << getDiagnosticString();
 }
 
-INSTANTIATE_TEST_CASE_P(ExpectSuccess, ValidateAMDShaderBallotCapabilities,
-                        ValuesIn(AMDShaderBallotGroupInstructions()));
+INSTANTIATE_TEST_SUITE_P(ExpectSuccess, ValidateAMDShaderBallotCapabilities,
+                         ValuesIn(AMDShaderBallotGroupInstructions()));
 
 TEST_P(ValidateAMDShaderBallotCapabilities, ExpectFailure) {
   // Fail because the module does not specify the SPV_AMD_shader_ballot
@@ -251,8 +251,8 @@ TEST_P(ValidateAMDShaderBallotCapabilities, ExpectFailure) {
                             " requires one of these capabilities: Groups")));
 }
 
-INSTANTIATE_TEST_CASE_P(ExpectFailure, ValidateAMDShaderBallotCapabilities,
-                        ValuesIn(AMDShaderBallotGroupInstructions()));
+INSTANTIATE_TEST_SUITE_P(ExpectFailure, ValidateAMDShaderBallotCapabilities,
+                         ValuesIn(AMDShaderBallotGroupInstructions()));
 
 struct ExtIntoCoreCase {
   const char* ext;
@@ -305,7 +305,7 @@ TEST_P(ValidateExtIntoCore, DoNotAskForExtensionInLaterVersion) {
 }
 
 // clang-format off
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     KHR_extensions, ValidateExtIntoCore,
     ValuesIn(std::vector<ExtIntoCoreCase>{
         // SPV_KHR_shader_draw_parameters became core SPIR-V 1.3

+ 3 - 3
3rdparty/spirv-tools/test/val/val_id_test.cpp

@@ -857,8 +857,8 @@ TEST_P(OpTypeArrayLengthTest, LengthNegative) {
 // capability prohibits usage of signed integers, we can skip 8-bit integers
 // here since the purpose of these tests is to check the validity of
 // OpTypeArray, not OpTypeInt.
-INSTANTIATE_TEST_CASE_P(Widths, OpTypeArrayLengthTest,
-                        ValuesIn(std::vector<int>{16, 32, 64}));
+INSTANTIATE_TEST_SUITE_P(Widths, OpTypeArrayLengthTest,
+                         ValuesIn(std::vector<int>{16, 32, 64}));
 
 TEST_F(ValidateIdWithMessage, OpTypeArrayLengthNull) {
   std::string spirv = kGLSL450MemoryModel + R"(
@@ -3918,7 +3918,7 @@ OpFunctionEnd
 }
 
 // Run tests for Access Chain Instructions.
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     CheckAccessChainInstructions, AccessChainInstructionTest,
     ::testing::Values("OpAccessChain", "OpInBoundsAccessChain",
                       "OpPtrAccessChain", "OpInBoundsPtrAccessChain"));

+ 3 - 3
3rdparty/spirv-tools/test/val/val_layout_test.cpp

@@ -120,7 +120,7 @@ const std::vector<std::string>& getInstructions() {
 static const int kRangeEnd = 1000;
 pred_type All = Range<0, kRangeEnd>();
 
-INSTANTIATE_TEST_CASE_P(InstructionsOrder,
+INSTANTIATE_TEST_SUITE_P(InstructionsOrder,
     ValidateLayout,
     ::testing::Combine(::testing::Range((int)0, (int)getInstructions().size()),
     // Note: Because of ID dependencies between instructions, some instructions
@@ -160,7 +160,7 @@ INSTANTIATE_TEST_CASE_P(InstructionsOrder,
                     , std::make_tuple(std::string("%fLabel   = OpLabel")       , Equals<39>             , All)
                     , std::make_tuple(std::string("OpNop")                     , Equals<40>             , Range<40,kRangeEnd>())
                     , std::make_tuple(std::string("OpReturn ; %func2 return")  , Equals<41>             , All)
-    )),);
+    )));
 // clang-format on
 
 // Creates a new vector which removes the string if the substr is found in the
@@ -181,7 +181,7 @@ std::vector<std::string> GenerateCode(std::string substr, int order) {
 }
 
 // This test will check the logical layout of a binary by removing each
-// instruction in the pair of the INSTANTIATE_TEST_CASE_P call and moving it in
+// instruction in the pair of the INSTANTIATE_TEST_SUITE_P call and moving it in
 // the SPIRV source formed by combining the vector "instructions".
 TEST_P(ValidateLayout, Layout) {
   int order;

+ 2 - 2
3rdparty/spirv-tools/test/val/val_literals_test.cpp

@@ -99,7 +99,7 @@ TEST_P(ValidateLiteralsShader, LiteralsShaderBad) {
                 "or sign extended when Signedness is 1"));
 }
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     LiteralsShaderCases, ValidateLiteralsShader,
     ::testing::Values("%11 = OpConstant %int16  !0xFFFF0000",  // Sign bit is 0
                       "%11 = OpConstant %int16  !0x00008000",  // Sign bit is 1
@@ -132,7 +132,7 @@ TEST_P(ValidateLiteralsKernel, LiteralsKernelBad) {
                 "or sign extended when Signedness is 1"));
 }
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     LiteralsKernelCases, ValidateLiteralsKernel,
     ::testing::Values("%2 = OpConstant %uint8  !0xABCDEF00",
                       "%2 = OpConstant %uint8  !0xABCDEFFF"));

+ 1 - 1
3rdparty/spirv-tools/test/val/val_memory_test.cpp

@@ -2101,7 +2101,7 @@ OpEntryPoint Fragment %func "func"
 OpExecutionMode %func OriginUpperLeft
 OpDecorate %array_t ArrayStride 4
 OpMemberDecorate %struct_t 0 Offset 0
-OpDecorate %struct_t BufferBlock
+OpDecorate %struct_t Block
 %uint_t = OpTypeInt 32 0
 %array_t = OpTypeRuntimeArray %uint_t
 %struct_t = OpTypeStruct %array_t

+ 26 - 26
3rdparty/spirv-tools/test/val/val_modes_test.cpp

@@ -510,7 +510,7 @@ TEST_P(ValidateModeGeometry, ExecutionMode) {
   }
 }
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     GeometryRequiredModes, ValidateModeGeometry,
     Combine(Combine(Values("InputPoints", ""), Values("InputLines", ""),
                     Values("InputLinesAdjacency", ""), Values("Triangles", ""),
@@ -584,7 +584,7 @@ TEST_P(ValidateModeExecution, ExecutionMode) {
   }
 }
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     ValidateModeGeometryOnlyGoodSpv10, ValidateModeExecution,
     Combine(Values(SPV_SUCCESS), Values(""), Values("Geometry"),
             Values("Invocations 3", "InputPoints", "InputLines",
@@ -592,7 +592,7 @@ INSTANTIATE_TEST_CASE_P(
                    "OutputPoints", "OutputLineStrip", "OutputTriangleStrip"),
             Values(SPV_ENV_UNIVERSAL_1_0)));
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     ValidateModeGeometryOnlyBadSpv10, ValidateModeExecution,
     Combine(Values(SPV_ERROR_INVALID_DATA),
             Values("Execution mode can only be used with the Geometry "
@@ -604,7 +604,7 @@ INSTANTIATE_TEST_CASE_P(
                    "OutputPoints", "OutputLineStrip", "OutputTriangleStrip"),
             Values(SPV_ENV_UNIVERSAL_1_0)));
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     ValidateModeTessellationOnlyGoodSpv10, ValidateModeExecution,
     Combine(Values(SPV_SUCCESS), Values(""),
             Values("TessellationControl", "TessellationEvaluation"),
@@ -613,7 +613,7 @@ INSTANTIATE_TEST_CASE_P(
                    "PointMode", "Quads", "Isolines"),
             Values(SPV_ENV_UNIVERSAL_1_0)));
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     ValidateModeTessellationOnlyBadSpv10, ValidateModeExecution,
     Combine(Values(SPV_ERROR_INVALID_DATA),
             Values("Execution mode can only be used with a tessellation "
@@ -624,15 +624,15 @@ INSTANTIATE_TEST_CASE_P(
                    "PointMode", "Quads", "Isolines"),
             Values(SPV_ENV_UNIVERSAL_1_0)));
 
-INSTANTIATE_TEST_CASE_P(ValidateModeGeometryAndTessellationGoodSpv10,
-                        ValidateModeExecution,
-                        Combine(Values(SPV_SUCCESS), Values(""),
-                                Values("TessellationControl",
-                                       "TessellationEvaluation", "Geometry"),
-                                Values("Triangles", "OutputVertices 3"),
-                                Values(SPV_ENV_UNIVERSAL_1_0)));
+INSTANTIATE_TEST_SUITE_P(ValidateModeGeometryAndTessellationGoodSpv10,
+                         ValidateModeExecution,
+                         Combine(Values(SPV_SUCCESS), Values(""),
+                                 Values("TessellationControl",
+                                        "TessellationEvaluation", "Geometry"),
+                                 Values("Triangles", "OutputVertices 3"),
+                                 Values(SPV_ENV_UNIVERSAL_1_0)));
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     ValidateModeGeometryAndTessellationBadSpv10, ValidateModeExecution,
     Combine(Values(SPV_ERROR_INVALID_DATA),
             Values("Execution mode can only be used with a Geometry or "
@@ -641,7 +641,7 @@ INSTANTIATE_TEST_CASE_P(
             Values("Triangles", "OutputVertices 3"),
             Values(SPV_ENV_UNIVERSAL_1_0)));
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     ValidateModeFragmentOnlyGoodSpv10, ValidateModeExecution,
     Combine(Values(SPV_SUCCESS), Values(""), Values("Fragment"),
             Values("PixelCenterInteger", "OriginUpperLeft", "OriginLowerLeft",
@@ -649,7 +649,7 @@ INSTANTIATE_TEST_CASE_P(
                    "DepthUnchanged"),
             Values(SPV_ENV_UNIVERSAL_1_0)));
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     ValidateModeFragmentOnlyBadSpv10, ValidateModeExecution,
     Combine(Values(SPV_ERROR_INVALID_DATA),
             Values("Execution mode can only be used with the Fragment "
@@ -661,15 +661,15 @@ INSTANTIATE_TEST_CASE_P(
                    "DepthUnchanged"),
             Values(SPV_ENV_UNIVERSAL_1_0)));
 
-INSTANTIATE_TEST_CASE_P(ValidateModeKernelOnlyGoodSpv13, ValidateModeExecution,
-                        Combine(Values(SPV_SUCCESS), Values(""),
-                                Values("Kernel"),
-                                Values("LocalSizeHint 1 1 1", "VecTypeHint 4",
-                                       "ContractionOff",
-                                       "LocalSizeHintId %int1"),
-                                Values(SPV_ENV_UNIVERSAL_1_3)));
+INSTANTIATE_TEST_SUITE_P(ValidateModeKernelOnlyGoodSpv13, ValidateModeExecution,
+                         Combine(Values(SPV_SUCCESS), Values(""),
+                                 Values("Kernel"),
+                                 Values("LocalSizeHint 1 1 1", "VecTypeHint 4",
+                                        "ContractionOff",
+                                        "LocalSizeHintId %int1"),
+                                 Values(SPV_ENV_UNIVERSAL_1_3)));
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     ValidateModeKernelOnlyBadSpv13, ValidateModeExecution,
     Combine(
         Values(SPV_ERROR_INVALID_DATA),
@@ -681,13 +681,13 @@ INSTANTIATE_TEST_CASE_P(
                "LocalSizeHintId %int1"),
         Values(SPV_ENV_UNIVERSAL_1_3)));
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     ValidateModeGLComputeAndKernelGoodSpv13, ValidateModeExecution,
     Combine(Values(SPV_SUCCESS), Values(""), Values("Kernel", "GLCompute"),
             Values("LocalSize 1 1 1", "LocalSizeId %int1 %int1 %int1"),
             Values(SPV_ENV_UNIVERSAL_1_3)));
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     ValidateModeGLComputeAndKernelBadSpv13, ValidateModeExecution,
     Combine(Values(SPV_ERROR_INVALID_DATA),
             Values("Execution mode can only be used with a Kernel or GLCompute "
@@ -697,7 +697,7 @@ INSTANTIATE_TEST_CASE_P(
             Values("LocalSize 1 1 1", "LocalSizeId %int1 %int1 %int1"),
             Values(SPV_ENV_UNIVERSAL_1_3)));
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     ValidateModeAllGoodSpv13, ValidateModeExecution,
     Combine(Values(SPV_SUCCESS), Values(""),
             Values("Kernel", "GLCompute", "Geometry", "TessellationControl",

+ 84 - 84
3rdparty/spirv-tools/test/val/val_non_uniform_test.cpp

@@ -182,63 +182,63 @@ TEST_P(GroupNonUniform, Spirv1p3) {
   }
 }
 
-INSTANTIATE_TEST_CASE_P(GroupNonUniformElect, GroupNonUniform,
-                        Combine(Values("OpGroupNonUniformElect"),
-                                Values("%bool"), ValuesIn(scopes), Values(""),
-                                Values("")));
-
-INSTANTIATE_TEST_CASE_P(GroupNonUniformVote, GroupNonUniform,
-                        Combine(Values("OpGroupNonUniformAll",
-                                       "OpGroupNonUniformAny",
-                                       "OpGroupNonUniformAllEqual"),
-                                Values("%bool"), ValuesIn(scopes),
-                                Values("%true"), Values("")));
-
-INSTANTIATE_TEST_CASE_P(GroupNonUniformBroadcast, GroupNonUniform,
-                        Combine(Values("OpGroupNonUniformBroadcast"),
-                                Values("%bool"), ValuesIn(scopes),
-                                Values("%true %u32_0"), Values("")));
-
-INSTANTIATE_TEST_CASE_P(GroupNonUniformBroadcastFirst, GroupNonUniform,
-                        Combine(Values("OpGroupNonUniformBroadcastFirst"),
-                                Values("%bool"), ValuesIn(scopes),
-                                Values("%true"), Values("")));
-
-INSTANTIATE_TEST_CASE_P(GroupNonUniformBallot, GroupNonUniform,
-                        Combine(Values("OpGroupNonUniformBallot"),
-                                Values("%u32vec4"), ValuesIn(scopes),
-                                Values("%true"), Values("")));
-
-INSTANTIATE_TEST_CASE_P(GroupNonUniformInverseBallot, GroupNonUniform,
-                        Combine(Values("OpGroupNonUniformInverseBallot"),
-                                Values("%bool"), ValuesIn(scopes),
-                                Values("%u32vec4_null"), Values("")));
-
-INSTANTIATE_TEST_CASE_P(GroupNonUniformBallotBitExtract, GroupNonUniform,
-                        Combine(Values("OpGroupNonUniformBallotBitExtract"),
-                                Values("%bool"), ValuesIn(scopes),
-                                Values("%u32vec4_null %u32_0"), Values("")));
-
-INSTANTIATE_TEST_CASE_P(GroupNonUniformBallotBitCount, GroupNonUniform,
-                        Combine(Values("OpGroupNonUniformBallotBitCount"),
-                                Values("%u32"), ValuesIn(scopes),
-                                Values("Reduce %u32vec4_null"), Values("")));
-
-INSTANTIATE_TEST_CASE_P(GroupNonUniformBallotFind, GroupNonUniform,
-                        Combine(Values("OpGroupNonUniformBallotFindLSB",
-                                       "OpGroupNonUniformBallotFindMSB"),
-                                Values("%u32"), ValuesIn(scopes),
-                                Values("%u32vec4_null"), Values("")));
-
-INSTANTIATE_TEST_CASE_P(GroupNonUniformShuffle, GroupNonUniform,
-                        Combine(Values("OpGroupNonUniformShuffle",
-                                       "OpGroupNonUniformShuffleXor",
-                                       "OpGroupNonUniformShuffleUp",
-                                       "OpGroupNonUniformShuffleDown"),
-                                Values("%u32"), ValuesIn(scopes),
-                                Values("%u32_0 %u32_0"), Values("")));
-
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(GroupNonUniformElect, GroupNonUniform,
+                         Combine(Values("OpGroupNonUniformElect"),
+                                 Values("%bool"), ValuesIn(scopes), Values(""),
+                                 Values("")));
+
+INSTANTIATE_TEST_SUITE_P(GroupNonUniformVote, GroupNonUniform,
+                         Combine(Values("OpGroupNonUniformAll",
+                                        "OpGroupNonUniformAny",
+                                        "OpGroupNonUniformAllEqual"),
+                                 Values("%bool"), ValuesIn(scopes),
+                                 Values("%true"), Values("")));
+
+INSTANTIATE_TEST_SUITE_P(GroupNonUniformBroadcast, GroupNonUniform,
+                         Combine(Values("OpGroupNonUniformBroadcast"),
+                                 Values("%bool"), ValuesIn(scopes),
+                                 Values("%true %u32_0"), Values("")));
+
+INSTANTIATE_TEST_SUITE_P(GroupNonUniformBroadcastFirst, GroupNonUniform,
+                         Combine(Values("OpGroupNonUniformBroadcastFirst"),
+                                 Values("%bool"), ValuesIn(scopes),
+                                 Values("%true"), Values("")));
+
+INSTANTIATE_TEST_SUITE_P(GroupNonUniformBallot, GroupNonUniform,
+                         Combine(Values("OpGroupNonUniformBallot"),
+                                 Values("%u32vec4"), ValuesIn(scopes),
+                                 Values("%true"), Values("")));
+
+INSTANTIATE_TEST_SUITE_P(GroupNonUniformInverseBallot, GroupNonUniform,
+                         Combine(Values("OpGroupNonUniformInverseBallot"),
+                                 Values("%bool"), ValuesIn(scopes),
+                                 Values("%u32vec4_null"), Values("")));
+
+INSTANTIATE_TEST_SUITE_P(GroupNonUniformBallotBitExtract, GroupNonUniform,
+                         Combine(Values("OpGroupNonUniformBallotBitExtract"),
+                                 Values("%bool"), ValuesIn(scopes),
+                                 Values("%u32vec4_null %u32_0"), Values("")));
+
+INSTANTIATE_TEST_SUITE_P(GroupNonUniformBallotBitCount, GroupNonUniform,
+                         Combine(Values("OpGroupNonUniformBallotBitCount"),
+                                 Values("%u32"), ValuesIn(scopes),
+                                 Values("Reduce %u32vec4_null"), Values("")));
+
+INSTANTIATE_TEST_SUITE_P(GroupNonUniformBallotFind, GroupNonUniform,
+                         Combine(Values("OpGroupNonUniformBallotFindLSB",
+                                        "OpGroupNonUniformBallotFindMSB"),
+                                 Values("%u32"), ValuesIn(scopes),
+                                 Values("%u32vec4_null"), Values("")));
+
+INSTANTIATE_TEST_SUITE_P(GroupNonUniformShuffle, GroupNonUniform,
+                         Combine(Values("OpGroupNonUniformShuffle",
+                                        "OpGroupNonUniformShuffleXor",
+                                        "OpGroupNonUniformShuffleUp",
+                                        "OpGroupNonUniformShuffleDown"),
+                                 Values("%u32"), ValuesIn(scopes),
+                                 Values("%u32_0 %u32_0"), Values("")));
+
+INSTANTIATE_TEST_SUITE_P(
     GroupNonUniformIntegerArithmetic, GroupNonUniform,
     Combine(Values("OpGroupNonUniformIAdd", "OpGroupNonUniformIMul",
                    "OpGroupNonUniformSMin", "OpGroupNonUniformUMin",
@@ -248,45 +248,45 @@ INSTANTIATE_TEST_CASE_P(
             Values("%u32"), ValuesIn(scopes), Values("Reduce %u32_0"),
             Values("")));
 
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
     GroupNonUniformFloatArithmetic, GroupNonUniform,
     Combine(Values("OpGroupNonUniformFAdd", "OpGroupNonUniformFMul",
                    "OpGroupNonUniformFMin", "OpGroupNonUniformFMax"),
             Values("%float"), ValuesIn(scopes), Values("Reduce %float_0"),
             Values("")));
 
-INSTANTIATE_TEST_CASE_P(GroupNonUniformLogicalArithmetic, GroupNonUniform,
-                        Combine(Values("OpGroupNonUniformLogicalAnd",
-                                       "OpGroupNonUniformLogicalOr",
-                                       "OpGroupNonUniformLogicalXor"),
-                                Values("%bool"), ValuesIn(scopes),
-                                Values("Reduce %true"), Values("")));
-
-INSTANTIATE_TEST_CASE_P(GroupNonUniformQuad, GroupNonUniform,
-                        Combine(Values("OpGroupNonUniformQuadBroadcast",
-                                       "OpGroupNonUniformQuadSwap"),
-                                Values("%u32"), ValuesIn(scopes),
-                                Values("%u32_0 %u32_0"), Values("")));
-
-INSTANTIATE_TEST_CASE_P(GroupNonUniformBallotBitCountScope, GroupNonUniform,
-                        Combine(Values("OpGroupNonUniformBallotBitCount"),
-                                Values("%u32"), ValuesIn(scopes),
-                                Values("Reduce %u32vec4_null"), Values("")));
-
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(GroupNonUniformLogicalArithmetic, GroupNonUniform,
+                         Combine(Values("OpGroupNonUniformLogicalAnd",
+                                        "OpGroupNonUniformLogicalOr",
+                                        "OpGroupNonUniformLogicalXor"),
+                                 Values("%bool"), ValuesIn(scopes),
+                                 Values("Reduce %true"), Values("")));
+
+INSTANTIATE_TEST_SUITE_P(GroupNonUniformQuad, GroupNonUniform,
+                         Combine(Values("OpGroupNonUniformQuadBroadcast",
+                                        "OpGroupNonUniformQuadSwap"),
+                                 Values("%u32"), ValuesIn(scopes),
+                                 Values("%u32_0 %u32_0"), Values("")));
+
+INSTANTIATE_TEST_SUITE_P(GroupNonUniformBallotBitCountScope, GroupNonUniform,
+                         Combine(Values("OpGroupNonUniformBallotBitCount"),
+                                 Values("%u32"), ValuesIn(scopes),
+                                 Values("Reduce %u32vec4_null"), Values("")));
+
+INSTANTIATE_TEST_SUITE_P(
     GroupNonUniformBallotBitCountBadResultType, GroupNonUniform,
     Combine(
         Values("OpGroupNonUniformBallotBitCount"), Values("%float", "%int"),
         Values(SpvScopeSubgroup), Values("Reduce %u32vec4_null"),
         Values("Expected Result Type to be an unsigned integer type scalar.")));
 
-INSTANTIATE_TEST_CASE_P(GroupNonUniformBallotBitCountBadValue, GroupNonUniform,
-                        Combine(Values("OpGroupNonUniformBallotBitCount"),
-                                Values("%u32"), Values(SpvScopeSubgroup),
-                                Values("Reduce %u32vec3_null", "Reduce %u32_0",
-                                       "Reduce %float_0"),
-                                Values("Expected Value to be a vector of four "
-                                       "components of integer type scalar")));
+INSTANTIATE_TEST_SUITE_P(GroupNonUniformBallotBitCountBadValue, GroupNonUniform,
+                         Combine(Values("OpGroupNonUniformBallotBitCount"),
+                                 Values("%u32"), Values(SpvScopeSubgroup),
+                                 Values("Reduce %u32vec3_null", "Reduce %u32_0",
+                                        "Reduce %float_0"),
+                                 Values("Expected Value to be a vector of four "
+                                        "components of integer type scalar")));
 
 }  // namespace
 }  // namespace val

+ 1 - 1
3rdparty/spirv-tools/test/val/val_ssa_test.cpp

@@ -823,7 +823,7 @@ std::pair<std::string, bool> cases[] = {
     {"OpGetKernelWorkGroupSize", kNoNDrange},
     {"OpGetKernelPreferredWorkGroupSizeMultiple", kNoNDrange}};
 
-INSTANTIATE_TEST_CASE_P(KernelArgs, ValidateSSA, ::testing::ValuesIn(cases), );
+INSTANTIATE_TEST_SUITE_P(KernelArgs, ValidateSSA, ::testing::ValuesIn(cases));
 
 static const std::string return_instructions = R"(
   OpReturn

+ 2 - 2
3rdparty/spirv-tools/test/val/val_storage_test.cpp

@@ -137,7 +137,7 @@ TEST_P(ValidateStorage, OtherStorageInsideFunction) {
       "Variables must have a function[7] storage class inside of a function"));
 }
 
-INSTANTIATE_TEST_CASE_P(MatrixOp, ValidateStorage,
+INSTANTIATE_TEST_SUITE_P(MatrixOp, ValidateStorage,
                         ::testing::Values(
                              "Input",
                              "Uniform",
@@ -147,7 +147,7 @@ INSTANTIATE_TEST_CASE_P(MatrixOp, ValidateStorage,
                              "Private",
                              "PushConstant",
                              "AtomicCounter",
-                             "Image"),);
+                             "Image"));
 // clang-format on
 
 TEST_F(ValidateStorage, GenericVariableOutsideFunction) {

+ 4 - 4
3rdparty/spirv-tools/test/val/val_version_test.cpp

@@ -108,7 +108,7 @@ TEST_P(ValidateVersion, version) {
 }
 
 // clang-format off
-INSTANTIATE_TEST_CASE_P(Universal, ValidateVersion,
+INSTANTIATE_TEST_SUITE_P(Universal, ValidateVersion,
   ::testing::Values(
     //         Binary version,        Target environment
     std::make_tuple(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_0, vulkan_spirv, true),
@@ -165,7 +165,7 @@ INSTANTIATE_TEST_CASE_P(Universal, ValidateVersion,
   )
 );
 
-INSTANTIATE_TEST_CASE_P(Vulkan, ValidateVersion,
+INSTANTIATE_TEST_SUITE_P(Vulkan, ValidateVersion,
   ::testing::Values(
     //         Binary version,        Target environment
     std::make_tuple(SPV_ENV_VULKAN_1_0, SPV_ENV_UNIVERSAL_1_0, vulkan_spirv, true),
@@ -194,7 +194,7 @@ INSTANTIATE_TEST_CASE_P(Vulkan, ValidateVersion,
   )
 );
 
-INSTANTIATE_TEST_CASE_P(OpenCL, ValidateVersion,
+INSTANTIATE_TEST_SUITE_P(OpenCL, ValidateVersion,
   ::testing::Values(
     //         Binary version,     Target environment
     std::make_tuple(SPV_ENV_OPENCL_2_0, SPV_ENV_UNIVERSAL_1_0,       opencl_spirv, true),
@@ -247,7 +247,7 @@ INSTANTIATE_TEST_CASE_P(OpenCL, ValidateVersion,
   )
 );
 
-INSTANTIATE_TEST_CASE_P(OpenCLEmbedded, ValidateVersion,
+INSTANTIATE_TEST_SUITE_P(OpenCLEmbedded, ValidateVersion,
   ::testing::Values(
     //         Binary version,              Target environment
     std::make_tuple(SPV_ENV_OPENCL_EMBEDDED_2_0, SPV_ENV_UNIVERSAL_1_0,       opencl_spirv, true),

+ 3 - 0
3rdparty/spirv-tools/tools/reduce/reduce.cpp

@@ -20,6 +20,7 @@
 #include "source/opt/build_module.h"
 #include "source/opt/ir_context.h"
 #include "source/opt/log.h"
+#include "source/reduce/merge_blocks_reduction_opportunity_finder.h"
 #include "source/reduce/operand_to_const_reduction_opportunity_finder.h"
 #include "source/reduce/operand_to_dominating_id_reduction_opportunity_finder.h"
 #include "source/reduce/operand_to_undef_reduction_opportunity_finder.h"
@@ -240,6 +241,8 @@ int main(int argc, const char** argv) {
   reducer.AddReductionPass(
       spvtools::MakeUnique<
           StructuredLoopToSelectionReductionOpportunityFinder>());
+  reducer.AddReductionPass(
+      spvtools::MakeUnique<MergeBlocksReductionOpportunityFinder>());
 
   reducer.SetMessageConsumer(spvtools::utils::CLIMessageConsumer);
 

Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików