Squashed 'third_party/SPIRV-Tools/' changes from e9dc2c8ce..51892874b

51892874b Run ADCE when the printf extension is used. (#5215)
e803fe671 Don't convert struct members to half (#5201)
d6310f416 Roll external/googletest/ a3580180d..bc860af08 (1 commit) (#5216)
8993f9f52 Apply scalar replacement on vars with Pointer decorations (#5208)
01055c60c Update the contributing guidelines (#5212)
65f03bea4 Roll external/spirv-headers/ 7f1d2f415..268a06176 (2 commits) (#5214)
2189ad7a5 spirv-tools: Add support for QNX (#5211)
17be6bb7c Roll external/googletest/ f345b2ca6..a3580180d (2 commits) (#5210)
a525dccbe roll deps (#5209)
0ce36ad78 instrument: Add set and binding to bindless error records (#5204)
08d8fae58 Roll external/googletest/ 0bdaac5a1..797b0ad2a (1 commit) (#5207)
8e1001e93 Roll external/googletest/ dea0484e4..0bdaac5a1 (1 commit) (#5206)
baa46e103 Update spirv_headers to include SPV_KHR_ray_tracing_position_fetch (#5205)
6110f30a3 Roll external/googletest/ 783d00fd1..ccdeec888 (1 commit) (#5203)
d4c0abdca instrument: Change descriptor state storage format (#5178)
9e627132a Roll external/googletest/ 12a5852e4..783d00fd1 (9 commits) (#5198)
25ad5e19f Do not define GOOGLE_PROTOBUF_INTERNAL_DONATE_STEAL_INLINE if it is already defined. (#5200)
bec566a32 opt: Fix null deref in OpMatrixTimesVector and OpVectorTimesMatrix (#5199)
d5f69dba5 Remove dead code (#5195)
55bc37f82 Roll external/googletest/ 8fa9461cc..12a5852e4 (1 commit) (#5193)
6f276e05c Add support for SPV_EXT_shader_tile_image (#5188)
1877a7f90 Fix vector OpConstantComposite type validation (#5191)
f449fb4ad Add default case for spv::Dim for TileImageEXT (#5194)
9a4e7a1eb Update protobuf to v21.12 (#5189)
31c546e31 Roll external/googletest/ 057b4e904..8fa9461cc (2 commits) (#5192)
048faf2e5 Remove use of deprecated std::aligned_storage (#5183)
13ea01b3e Roll external/googletest/ 7ee260c54..057b4e904 (1 commit) (#5190)
dd03c1fca Fix LICMPass (#5087)
97a55196d Roll external/googletest/ b5fd99bbd..7ee260c54 (1 commit) (#5187)
ac335c763 roll deps (#5185)
a2db3fb17 kokoro: always chown files (#5186)
6b72fe20c Add missing header guard (#5181)
7ab0a2781 Remove non-ascii char from comments. (#5182)
f5ff7ae4a Roll external/googletest/ 88af49efa..ca0d46e95 (4 commits) (#5180)
a0fcd06f8 Add Vulkan memory model to allow lists (#5173)
d8a8af8e6 spirv-val: Remove unused includes and code (#5176)
4680d2bef Roll external/googletest/ e9fb5c7ba..88af49efa (1 commit) (#5179)
fa69b09cf spirv-opt: Remove unused includes and code (#5177)
d24a39a7f Do not remove control barrier after spv1.3 (#5174)
f9f31fa5a Roll external/googletest/ 6f01e3dc1..e9fb5c7ba (2 commits) (#5175)
b4e0850ef Ignore NonSemanticInstructions (#5171)
32a4d840b roll deps (#5172)
9fbe1738b Update SPIRV-Headers deps (#5170)
5f4e694e1 Implement source extraction logic for spirv-objdump (#5150)
5aab2a8fe Include stdint.h (#5164)
1a52c14ee Roll external/googletest/ fa8720982..974e18ee6 (2 commits) (#5168)
90f6a2875 Roll external/googletest/ 471087fbf..fa8720982 (2 commits) (#5167)
4dc3edeb9 build: set std=c++17 for BUILD.gn (#5162)
f56f2b6fd roll deps (#5166)
9c9144b65 ci: fix dependency updater bot (#5165)
ae435df4a git: add release workflow (#5158)
44bc9bd2a build: cmake: support passing a custom source folder for GoogleTest (#5157)
8e6563b91 spirv-val: Label new Vulkan VUID 07951 (#5154)
9743701ed Explicitly #include <utility> in spirv_target_env.cpp (#5159)
25f6c0cea Revert "Add workflow for github releases. (#5145)" (#5156)
a45a4cd21 Roll external/googletest/ 038e392eb..391ce627d (1 commit) (#5153)
a1f555651 build(deps): bump y18n from 4.0.0 to 4.0.3 in /tools/sva (#5155)
25b7608cb Add workflow for github releases. (#5145)
fcd53c8ed Add spirv-dump tool (#5146)
7cefd5f5f Change default permissions for workflows (#5149)
44d72a9b3 Prepare release v2023.2 (#5151)
fba26fd60 roll deps (#5152)
01828dac7 Roll external/googletest/ 48a1b1105..50e07d1c9 (1 commit) (#5148)
b029037aa Revert changes around CHANGES file. (#5143)
c069a5c7e roll deps (#5144)
42267721e build: tool to generate a CHANGELOG from tags (#5136)
db0c3d83d Roll external/googletest/ e1ee0fa3e..a798c2f10 (4 commits) (#5142)
690a9a406 Add explicit deduction guide for FlagRegistration (#5141)
3033cf428 Roll external/googletest/ cead3d57c..e1ee0fa3e (9 commits) (#5140)
016bb3ae7 roll deps (#5139)
7cb5898e1 diff: refactorize flag parsing (#5133)
e0df12997 Fix using invalid install path for cmake support files with MINGW platform (#5128) (#5129)
3eff21366 Fix MinGW build error (#4935) (#5127)
bd83b772c Fix operand index out of bounds when folding OpCompositeExtract. (#5107)
5fe3bbe77 Update Effcee so it doesn't hardcode C++11 (#5137)
6c714f191 Roll external/googletest/ c7d0bc830..2d4f20876 (3 commits) (#5130)
d6c707676 linter: refactorize linter flag parsing (#5134)
8cee46198 tools: add uint32_t flags parsing (#5131)
970ba4e8b linker: refactorize flag parsing (#5132)
9d71fb676 Roll external/googletest/ 3d787f5a0..c7d0bc830 (4 commits) (#5126)
9d4c95a57 build: fix build.gn missing comma (#5125)
2e0f4b52c tools: refactorize tools flags parsing. (#5111)
3b2ea1a42 Roll external/googletest/ 39a26e12d..3d787f5a0 (2 commits) (#5123)
b955c468b Add missing header include (#5124)
5d2bc6f06 Fix removal of dependent non-semantic instructions (#5122)
4183faa2e Roll external/googletest/ 750d67d80..39a26e12d (2 commits) (#5120)
2cf48e953 Allow invoking git.bat as git on Windows (#5118)
9017cfcf6 Roll external/googletest/ 7a7231c44..750d67d80 (1 commit) (#5119)
8bcaad28f Roll external/re2/ 9049cd28d..3a8436ac4 (1 commit) (#5117)
987a5f136 build: change the way we set cxx version for bazel. (#5114)
69ed5adf1 Roll external/googletest/ f063cd25c..7a7231c44 (1 commit) (#5116)
c9947cc8d Roll external/googletest/ 2057566e4..f063cd25c (1 commit) (#5115)
956114df2 opt: fix spirv ABI on Linux again. (#5113)
f4343515a Remove duplicate lists of constant and type opcodes (#5106)
95f93810b Roll external/googletest/ b80a07ffe..2057566e4 (1 commit) (#5112)
b84c86f71 libspirv.cpp: adds c++ api for spvBinaryParse (#5109)
e150e716f roll deps (#5110)
722138136 Roll external/re2/ b025c6a3a..891fa6684 (1 commit) (#5108)
5b48c549b Roll external/googletest/ 0570e2d93..b73f27fd1 (1 commit) (#5105)
dfcbf310a Change exec_tools -> tools for local genrule (#5104)
b0504f990 Roll external/googletest/ 3d568bdda..0570e2d93 (2 commits) (#5102)
c965624e3 Roll external/googletest/ 2f2e72bae..3d568bdda (1 commit) (#5100)
0ce2bc4ce spirv-val: Conditional Branch without an exit is invalid in loop header (#5069)

git-subtree-dir: third_party/SPIRV-Tools
git-subtree-split: 51892874ba08f3ac0d9b1fcf3893c8516693a88e
Change-Id: I4a42eed4fc8a249a67dce8a793b482ed48d6ebdb
diff --git a/test/opt/eliminate_dead_functions_test.cpp b/test/opt/eliminate_dead_functions_test.cpp
index 96deb2a..e9f79a1 100644
--- a/test/opt/eliminate_dead_functions_test.cpp
+++ b/test/opt/eliminate_dead_functions_test.cpp
@@ -517,6 +517,39 @@
   SinglePassRunAndMatch<EliminateDeadFunctionsPass>(text, true);
 }
 
+TEST_F(EliminateDeadFunctionsBasicTest, DependentNonSemanticChain) {
+  const std::string text = R"(
+; CHECK: OpEntryPoint GLCompute [[main:%\w+]]
+; CHECK: [[main]] = OpFunction
+; CHECK-NOT: = OpFunction
+; CHECK: [[ext1:%\w+]] = OpExtInst %void {{%\w+}} 1 [[main]]
+; CHECK: [[ext2:%\w+]] = OpExtInst %void {{%\w+}} 2 [[ext1]]
+; CHECK: [[ext3:%\w+]] = OpExtInst %void {{%\w+}} 3 [[ext1]] [[ext2]]
+OpCapability Shader
+OpExtension "SPV_KHR_non_semantic_info"
+%1 = OpExtInstImport "NonSemantic.Test"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+OpExecutionMode %main LocalSize 1 1 1
+%void = OpTypeVoid
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%main_entry = OpLabel
+OpReturn
+OpFunctionEnd
+%dead = OpFunction %void None %void_fn
+%dead_entry = OpLabel
+OpReturn
+OpFunctionEnd
+%2 = OpExtInst %void %1 1 %main
+%3 = OpExtInst %void %1 2 %2
+%4 = OpExtInst %void %1 3 %2 %3
+)";
+
+  SetTargetEnv(SPV_ENV_VULKAN_1_0);
+  SinglePassRunAndMatch<EliminateDeadFunctionsPass>(text, true);
+}
+
 }  // namespace
 }  // namespace opt
 }  // namespace spvtools