Squashed 'third_party/SPIRV-Tools/' changes from f37547c73..339d4475c

339d4475c Improve decoration validation (#4490)
1589720e1 spirv-opt: create OpDecorate for OpMemberDecorate in desc-sroa (#4617)
6b073f899 Run the wasm build on push and pull_request (#4614)
66ef7cb68 Remove publish-to-npm step for Wasm build (#4610)
d645ea270 Update CHANGES, README for WebAssembly build (#4609)
0d0013002 Add Wasm build (#3752)
1082de6bb Handle overflowing id in merge return (#4606)
97d449560 Avoid bitwise and in boolean expression (#4603)
e3c709810 In generated cmake config file for SPIRV-Tools only access cmake target, if present (#4590)
e3a373f2b Make cxx exceptions controllable  (#4591)
c194bb2a7 spirv-val Update LocalSizeId VUID (#4602)
6c7885dbd Change branch handling in ADCE to fix errors (#4596)
bd5bf754b Fix Linker generator ID (#4601)
791f5b463 Only validate workgroup layout for explicit workgroup memory (#4542)
2feb7074d Avoid confusing short-circuiting (#3404)
7c5b17d37 Update passes to handle function declarations (#4599)
b2ba019bf Delete decorations before replaces uses in dead branch elim (#4598)
3291b6951 Do not fold snegate feeding sdiv. (#4600)
d997c83b1 Add spirv-opt pass to replace descriptor accesses based on variable indices (#4574)
d78c1c4cd Make IsLocalVar in ADCE work at any time. (NFC) (#4595)
8c91f14a9 Add libFuzzer target for spirv-fuzz (#4434)
17a5bacfa Handle missing execution modes for limitation check (#4594)
7326b494d opt: set upper bits of spec constant according to spec (#4589)
f3fbd98ff opt/spec_constants: fix bit pattern width checks. (#4588)
0f3bc1d9b Fix i386 build issues related to random generation (#4586)
001604bd4 Generate constants directly in CreateDebugInlinedAt (#4572)
7a7a69037 README: Remove appveyor build badge. (#4584)
4578db3c4 README: Update tested versions of compilers (#4579)
387cae472 Opt passes should apply to the exported functions (#4554)
35fd0e17d Consider 0xffffffff offset as missing (#4564)
06ebc4806 Account for strided components in arrays (#4575)
10343e53e Remove Appveyor CI, update README (#4578)
3e6a85303 Mark DebugInfoNone as live in ADCE when DebugInfo present (#4568)
e6e77dbdf Enable OpConstFunctionPointerINTEL outside function (#4576)
5ed637caa Fix output of SPIR-V version in diagnostic (#4562)
d31218c56 Use max enum instead of static array of legal values (#4571)
0292d6b16 Update SPIRV-Headers (#4573)
6dd73728e Fix merge-block assertions with debugInfo (#4563)
e4349dd8f Fix CI failure (#4570)
b46995741 Avoid bugprone-move-forwarding-reference warning in Clang (#4560)
0c4deebc9 Include a maximum value for spv_target_env (#4559)
63a391232 Fix ConstantManager to not run AnalyzeInstDefUse if DefUse not valid (#4557)
2d12367ce Stop consuming input in fuzzers to select target environment (#4544)
eeb973f50 More ADCE refactoring (#4548)
9529d3c2c Avoid implicit fallthrough, by duplicating code (#4556)
24476c2e3 spirv-opt: Don't eliminate dead members from StructuredBuffer (#4553)
3234daada Do not assume there are execution modes (#4555)
ba4b390c3 Suppress protobuf warning (#4551)
c3adcb034 Adce refactor (NFC) (#4547)
19dc86c48 Handle NonSemantic.Shader Debug[No]Line (#4530)
f125452cf Fix inst_buff_addr_check to handle struct loads (#4489)
134d763f4 GN: Fix build for debuginfo codegen. (#4536)
1d48824ba Update SPIRV-Headers (#4543)
a6c5056db Fix checks for offset in nested structs (#4531)
0f4508752 Fix UBSan error in spirv-dis fuzzer (#4517)
59f51bb4f Fix extract with out-of-bounds index (#4529)
1454c95d1 spirv-opt: Switch from Vulkan.DebugInfo to Shader.DebugInfo (#4493)
4ac8e5e54 Add preserve_interface mode to aggressive_dead_code_elim (#4520)
9e65f054d spirv-fuzz: Account for differing signedness in WrapVectorSynonym (#4414)
36ff13534 spirv-opt: Avoid integer overflow during constant folding (#4511)
cb6c66917 Roll external/googletest/ b7d472f12..955c7f837 (111 commits) (#4521)
846b032b5 Fix infinite loop in validation (#4523)
bf463fe37 Fix UBSan kokoro config (#4522)
5efeaad30 Fix bad order of checks in atomic validation (#4524)
8865b2029 Handle out-of-bounds accesses in VDCE (#4518)
4f4f76037 Change validator boolean tests to avoid asserts (#4503)
912460e46 Fix infinite loop in GetBlockDepth (#4519)
013b1f3d6 Fix validation message for cooperative matrix column type (#4502)
2a938fcfa Add UBSan kokoro configuration (#4512)
c16224c68 Add some missing switch validation (#4507)
92868b8f3 spirv-val: Fix ubsan error (#4505)
4db6b8dcc Remove environment features that are never used (#4491)
7e860e383 fix parsing of bad binary exponents in hex floats (#4501)
789de0dc4 Adjust build for fuzzer targets to support OSS-Fuzz (#4498)
0c09258e0 Set threshold for reduce-load-size pass (#4499)
bd3a271ce Handle exported functions in ADCE (#4495)
702e6af38 Only add `-DSPIRV_CHECK_CONTEXT` for Debug builds (#4496)
b8fce5f9e spirv-lint: Add lint based on divergence analysis (#4488)
ee3077365 Add a feature for allowing LocalSizeId (#4492)
2a5cc342f Start SPIRV-Tools v2021.4
1fbed83c8 Finalize SPIRV-Tools v2021.3
3d4246b4a Update CHANGES
a1d5d67ae spirv-val: Validate vulkan debug info similarly to opencl debug info (#4466)
937227c76 Add divergence analysis to linter (#4465)
d699296b4 spirv-val: Fix WorkgroupSize VUID 04425 (#4482)
1ad8b7135 spirv-lint: add basic CLI argument handling (#4478)
a9ce5e07c Fix matrix stride validation (#4468)
e172833bd Don't double count variables for location validation (#4474)
926ff6d1b GN: Suppress unreachable code warnings. (#4476)
57e1d8ebe Add spirv-opt convert-to-sampled-image pass (#4340)
b2e36b67e Disallow loading a runtime-sized array (#4473)
2c829c415 Fix early-out for Clamp constant folding (#4461)
869a550d2 Don't fold unsigned divides of an constant and a negation (#4457)
881001070 fix SIGSEGV when reading from a non-existant file (#4453)
00b106e76 Limit location validation (#4467)
54524ffa6 Update SPIRV-Headers (#4463)
de69f32e8 spirv-opt: Add handling of vulkan debug info to DebugInfoManager (#4423)
c4c6f2ba5 spirv-opt: Add dataflow analysis framework (#4402)
f9d03bb40 Remove PCH from source/lint/CMakeLists.txt (#4459)
706dc27a6 Add new target for spirv-lint (#4446)
3510a14cf Add a section releases to the README (#4444)
175ecd49e Fix array layout validation slowdown (#4449)
07f130235 spirv-fuzz: Support AtomicStore (#4440)
366d1be5e fuzzers: Disable suggest-destructor-override warning (#4439)
3ab6fb9c0 Add CMake rules for libFuzzer targets (#4445)
0065c5672 spirv-fuzz: support AtomicLoad (#4330)
affe280c2 Add GraphicsFuzz shaders to fuzzer corpus (#4429)
c5bda7ae5 Fuzzer: Default the new constructor parameter (#4438)
5737dbb06 Fix validator crash (#4418)
17bf44376 spirv-fuzz: Add minimal SPIR-V example to test shaders (#4415)
c6422cff3 spirv-opt: Rename ControlDependenceAnalysis::DoesBlockExist to HasBlock (#4412)
983ee2313 spirv-opt: Add specific handling of vulkan debug info differences (#4398)
9c4481419 spirv-fuzz: Allow inapplicable transformations to be ignored (#4407)
c9e094cc4 spirv-fuzz: Quit fuzzer pass when no types are available (#4409)
4bcd13ff1 spirv-opt: Add more tests to control dependence  (#4410)
7dadcf9c7 Add control dependence analysis to opt (#4380)
11cd875ed spirv-fuzz: Use reference in CanMakeSynonymOf (#4401)
4376a10c1 Fix public deps on generated headers (#4386)
b2db20a7e BUILD.gn: introduce finer grained internal targets for Tint (#4399)
63238d4f2 Initialize context in `opt::Instruction`'s move constructor (#4397)
183fb9fe4 spirv-fuzz: Fix problem with instruction context (#4394)
94bcae134 spirv-fuzz: Avoid out-of-bounds access (#4395)
cc3fe2b67 spirv-fuzz: Fix vector wrapping fuzzer pass (#4392)
2419f3be8 spirv-fuzz: Tighten checks on null and undef pointers (#4367)
2a7a561c0 Fix local size hint id tests (#4400)
d9f892578 spirv-opt: Where possible make code agnostic of opencl/vulkan debuginfo (#4385)
033768c24 spirv-fuzz: TransformationWrapVectorSynonym that rewrites scalar operations using vectors (#4376)
f084bcfe2 spirv-fuzz: Support atomic operations opcode (#4348)
3a68a7274 CMake: add ENABLE_RTTI option (#4382)
8966cc2b2 Add common enum for debug info instructions from either opencl or vulkan (#4377)
5427d5cf0 Don't mention VS2013 in PR review instructions (#4384)
7320b9acd Explain how to run tests with CMake and Bazel (#4383)
e0937d7fd spirv-fuzz: Don't replace memory semantics / scope operands (#4349)
2685c9a68 Add missing fuzzer header dependency. (#4381)
640b17b5f Fix -Wunreachable-code-aggressive. (#4358)
4baf3affe spirv-opt: support SPV_EXT_shader_image_int64 (#4379)
feb05446b Fix BUILD.gn (#4378)
2299b710d spirv-fuzz: support building using gn (#4365)
d432bebb1 Fix vendor table build in BUILD.gn for nonsemantic.vulkan.debuginfo.100 (#4375)
3b6abf41c Add non-semantic vulkan extended instruction set (#4362)
c26baf4c9 Update SPIRV-Headers deps (#4369)
9ce7a2fb6 spirv-reduce: Eliminate skeletal structured control flow construct (#4360)
4d2832e3c spirv-fuzz: Check updated analyses in transformation tests (#4266)
776336052 spirv-fuzz: Added tests for signedness analysis (#4361)
a95bc460f Add remove_unused_interface_variable_pass.* to BUILD.gn (#4363)
c67f13208 add tests for SPV_KHR_bit_instructions (#4350)
06f114d48 spirv-fuzz: Avoid out of bounds access (#4355)
74e8105eb Enabled tvOS platform (#4329)
f9893c454 spirv-opt: A pass to removed unused input on OpEntryPoint instructions. (#4275)
8442a1812 Bump glob-parent from 5.0.0 to 5.1.2. (#4353)
eeff9af1e fix strncpy bound error (#4331)
b8587c984 spirv-reduce: Allow merging unreachable blocks (#4303)
4fcdc5894 Add IsReachable function to IRContext (#4323)
237173a07 spirv-reduce: Cleanup a few things (#4352)
8cc8b6562 spirv-fuzz: Add illustrative tests for new issues (#4347)
3a02d1126 Add validation for SPV_EXT_shader_atomic_float16_add (#4325)
e065c482c Initial support for SPV_KHR_integer_dot_product (#4327)
e992c96c8 fix symbol exports check, for Android build cases (#4342)
0c21e5092 Start SPIRV-Tools v2021.3
e198c6a78 Finalize SPIRV-Tools v2021.2
f8eafd4d8 spirv-val: Label VUID 04780 (#4334)
e84bcb251 spirv-val: Add GLCompute to VUID 04644 message (#4333)
5dd2f7691 Update CHANGES file for upcoming release.
bcef91374 Update SPIRV-Headers deps (#4328)
4d22f58a8 Support SPV_KHR_subgroup_uniform_control_flow (#4318)
ecdd9a3e6 spirv-val: Vulkan Storage Class for Execution Model (#4212)
edc3a2478 Add SPV_KHR_vulkan_memory_model to aggressive_dead_code_elim (#4320)
bbc660eda Support Intel extensions for fixed point and hls-float (#4321)
9dbca316a spirv-fuzz: Improve TransformationAddBitInstructionSynonym to check integer signedness (#4312)
c1a75bfab spirv-fuzz: Support bitwise or and xor in TransformationAddBitInstructionSynonym (#4310)
d07505c76 Update lodash (#4317)
fb02131cb No error report for variable image offset when before-legal-hlsl is on (#4316)
87a286797 Add kInstErrorMax to instrument.hpp (#4315)
c05f74415 Spirv-fuzz: Add tests for MaybeGet* functions in fuzzerutil (#4284)
6d5c5677e Remove VS2013 kokoro build (#4314)
26cdce984 spirv-fuzz: add tests for full coverage of TransformationAccessChain (#4304)
c853a9114 spirv-fuzz: Added test to increase coverage of the add_parameter transformation (#4305)
126a826d3 Spirv-fuzz: Achieve coverage of TransformationAddDeadBlock test  (#4306)
8b3dc6bbe Check that valid bitcasted constant was returned (#4311)
0861a8fa2 spirv-fuzz: Fix OutlineFunction in presence of unreachable blocks (#4308)
9646c733e spirv-fuzz: Fix def-use update in PermutePhiOperands (#4309)
ec1bc3e2e spirv-fuzz: Added extra tests for AddTypeFloat and AddTypeInt transformations (#4292)
94f570d7a spirv-fuzz: Increase test coverage of TransformationCompositeConstruct (#4301)
00ce2bb47 spirv-fuzz: Enhancing permute function variables and its testing (#4295)
e2ac64bdf spirv-fuzz: Move ApplyTransformation to .cpp file (#4258)
91931ffcd spirv-fuzz: Enhance test to improve lines covered (#4289)
0afe1f2b3 spirv-fuzz: Cover protobuf message creation in tests (#4285)
f0d110e30 Invalidate analyses (#4260)
18d45142e Fix crash when optimizing shaders with DebugPrintf (#4280)
010cd289d Fix continue construct for single block loops (#4277)
f6b59599a spirv-fuzz: Respect control flow rules when merging returns (#4279)
de1cae069 val test: Update capability dependency (#4268)
1020e394c spirv-fuzz: Fix underflow problem in `fuzzer_pass_swap_two_functions` (#4253)
8ec9f456e Fix export symbol test. (#4254)
f30465d2b build: Fix Android build (#4157)
f8c78cc53 Updates to the vscode SPIR-V extension (#4246)
f82f5af5e Invalidate DefUse analysis (#4255)
089d716d2 Fix dangling phi bug from loop-unroll (#4239)
07ec4f83c Support folding OpBitcast with numeric constants (#4247)
6cdf07d2b spirv-fuzz: Swap positions of two functions in a module (#4236)
1b8341b8b Fix warning in python script. (#4251)
9f23457ee GraphicsRobustAccessPass: Set module_status_.modified (#4167)
8fe39ad58 spirv-fuzz: Permute the order of variables at function scope issue (#4248)
22b82872b Start SPIRV-Tools v2021.2
c2d5375fa Finalize SPIRV-Tools v2021.1
dc72924cb Update CHANGES
693d564db spriv-val: Fix clang-format bug for VUID string (#4238)
a02a9205f spirv-fuzz: Accept limitations in AddFunction (#4226)
ae6a1e1d2 Fix UWP build (#4235)
6210375e1 Fix clang-format-diff.py URL (#4233)
8da800c4c spirv-reduce: Remove redundant r-value references (#4232)
212895d4c Typo fix (#4225)
48007a5c7 Add interpolate legalization pass (#4220)
61e256c9c spirv-fuzz: Efficiency improvements to fuzzer pass (#4188)
2ee21fbde spirv-fuzz: Avoid invalidating analyses when splitting blocks (#4218)
22eb528f1 spirv-fuzz: Do not add too many dead blocks (#4217)
d0c73fcee spirv-fuzz: Optimize transformations (#4216)
f22793015 spirv-fuzz: Fix comments #4215
ecc840d30 Add validation for SPV_EXT_shader_atomic_float_min_max (#4105)
d20c9c2cf Make spirv-tools-build-version a common dependency (#4210)
bed84792f spirv-fuzz: Call by value and move in transformations (#4208)
c0833ce62 spirv-fuzz: Remove destructors from FuzzerPass subclasses (#4209)
3d3951796 spirv-fuzz: Improve transformation test oracles (#4207)
edb8399b0 spirv-fuzz: Add WGSL compatibility flag to context (#4193)
6382cbb49 spirv-fuzz: Avoid invalidating analyses in various transformations (#4205)
657889978 spirv-fuzz: Manage available instructions efficiently (#4177)
75d7c14cf spirv-fuzz: Remove AddType methods from fuzzerutil (#4204)
f2a19b015 spirv-val: Refactor of atomic pass (#4200)
8f421ced3 spirv-val: Label VUID 04643 (#4202)
2b0d16a05 spirv-val: Label VUID 04667 (#4201)
a732e4c03 spirv-fuzz: Apply fuzzer pass before checking exit conditions (#4199)
a611be778 spirv-val: Fix Int64Atomics check (#4192)
4f498774d Roll deps (#4185)
c040bd3ae spirv-val: Add Vulkan Execution Scope checks (#4183)
8866fd7ae spirv-fuzz: Locate instructions more efficiently (#4189)
db2a70646 spirv-fuzz: Make adding equation instructions more efficient (#4190)
e8ab7101f spirv-fuzz: Make PermutePhiOperands more efficient (#4191)
79ab273f9 Accept OpImageTexelPointer user in scalar-replacement (#4187)
042eff73f spirv-val: Add Vulkan Invocation Sematics check (#4182)
03f23106c spirv-val: Label VUID 04634 (#4181)
4100477e7 Support SPV_KHR_linkonce_odr, SPV_KHR_expect_assume (#4161)
478754c00 spirv-fuzz: Avoid invalidating analyses (#4176)
777990758 spirv-fuzz: Add buggy test (#4180)
9e93b165c Remove usage of std::iterator. (#4171)
5d8c40399 BUILD.gn: fix typo for 'cflags' (#4169)
77eb2b608 Suppress warning (#4168)
f7cf3ec2a spirv-fuzz: Avoid unnecessary dependency (#4165)
1746ed39d Add `void` in function declaration to keep some compilers happy (#4160)
4a59fd476 Fix -Wextra-semi-stmt -Wsuggest-destructor-override -Wdeprecated-copy-dtor (#4164)
c6da5e343 spirv-val: Vulkan 64-bit OpAtomicStore check (#4163)
e6a9f4e43 spirv-fuzz: Fix the bug in TransformationReplaceBranchFromDeadBlockWithExit (#4140)
7d514cf1c spirv-fuzz: Fix PartialCount (#4159)
f7043c0de spirv-fuzz: Handle Vulkan SPIR-V versions (#4156)
43cfa9bc1 spirv-fuzz: Add persistent state to the fuzzer (#4137)
939bc0260 Require an OpSelectionMerge before an OpSwitch (#4154)
0bd920eb9 Use standard function to get stdin to binary mode. (#4141)
d28186db9 Fixes for the vscode language server extension (#4150)
ef3290bbe spirv-opt: Don't call GenerateCopy for mismatched image types (#4126)
1b35745ad Start SPIRV-Tools v2021.0
07383c65d Finalize SPIRV-Tools v2020.7
05cda81ab Update CHANGES
c79edd260 Generate differentiated error codes for buffer oob checking (#4144)
cfa1dadb1 Update a few virtuals to overrides. (#4143)
f0c96f40c spriv-val: Vulkan image gather constant component (#4133)
3ad7e5fcc spirv-val: Fix/Label UniformConstant VUID (#4134)
f11f74348 spirv-val: Add Vulkan Invariant Decoration VUID (#4132)
c91a25af1 spirv-val: label tests for VUID 04657 (#4119)
d61a7d110 spirv-val: Add Vulkan PSB64 convert VUID (#4122)
297723d75 Mark module as modified if convert-to-half removes decorations. (#4127)
e8bd26e1f Set correct scope and line info for DebugValue (#4125)
b812fd634 Validate SPV_KHR_workgroup_memory_explicit_layout (#4128)
cc81f53d3 Validate VK_KHR_zero_initialize_workgroup_memory (#4124)
d71ac38b8 spirv-val: Add Vulkan image gather offset VUID (#4118)
a4f97da40 Add cmake to windows path for kokoro (#4129)
a61600c76 spirv-val: Label Vulkan atomic semantics VUIDs (#4120)
819117cd4 spirv-val: Label VUID 04662 (#4123)
89ad2272b spirv-val: Label VUID 04683 (#4121)
968659aee Remove obsolete GN config (#4110)

git-subtree-dir: third_party/SPIRV-Tools
git-subtree-split: 339d4475c1a806c187c57678af26733575d1cecd
diff --git a/test/opt/eliminate_dead_functions_test.cpp b/test/opt/eliminate_dead_functions_test.cpp
index 96ecdc6..96deb2a 100644
--- a/test/opt/eliminate_dead_functions_test.cpp
+++ b/test/opt/eliminate_dead_functions_test.cpp
@@ -439,6 +439,84 @@
   SinglePassRunAndMatch<EliminateDeadFunctionsPass>(text, true);
 }
 
+TEST_F(EliminateDeadFunctionsBasicTest, NonSemanticInfoRemoveDebugPrintf) {
+  const std::string text = R"(
+; CHECK-NOT: %foo_ = OpFunction %void None % 3
+; CHECK-NOT: % 7 = OpLabel
+; CHECK-NOT: %c = OpVariable %_ptr_Function_v4float Function
+; CHECK-NOT: % 22 = OpAccessChain %_ptr_UniformConstant_13 %samplers %int_0
+; CHECK-NOT: % 23 = OpLoad % 13 % 22
+; CHECK-NOT: % 27 = OpImageSampleExplicitLod %v4float % 23 % 26 Lod %float_0
+; CHECK-NOT: OpStore %c % 27
+; CHECK-NOT: % 31 = OpAccessChain %_ptr_Function_float %c %uint_0
+; CHECK-NOT: % 32 = OpLoad %float %31
+; CHECK-NOT: % 34 = OpExtInst %void %33 1 % 28 % 32
+OpCapability RayTracingKHR
+OpExtension "SPV_KHR_non_semantic_info"
+OpExtension "SPV_KHR_ray_tracing"
+%1 = OpExtInstImport "GLSL.std.450"
+%33 = OpExtInstImport "NonSemantic.DebugPrintf"
+OpMemoryModel Logical GLSL450
+OpEntryPoint ClosestHitNV %main "main" %samplers
+%28 = OpString "%f"
+OpSource GLSL 460
+OpSourceExtension "GL_EXT_debug_printf"
+OpName %main "main"
+OpName %foo_ "foo("
+OpName %c "c"
+OpName %samplers "samplers"
+OpDecorate %samplers DescriptorSet 0
+OpDecorate %samplers Binding 0
+%void = OpTypeVoid
+%3 = OpTypeFunction %void
+%float = OpTypeFloat 32
+%v4float = OpTypeVector %float 4
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+%12 = OpTypeImage %float 3D 0 0 0 1 Unknown
+%13 = OpTypeSampledImage %12
+%uint = OpTypeInt 32 0
+%uint_1 = OpConstant %uint 1
+%_arr_13_uint_1 = OpTypeArray %13 %uint_1
+%_ptr_UniformConstant__arr_13_uint_1 = OpTypePointer UniformConstant %_arr_13_uint_1
+%samplers = OpVariable %_ptr_UniformConstant__arr_13_uint_1 UniformConstant
+%int = OpTypeInt 32 1
+%int_0 = OpConstant %int 0
+%_ptr_UniformConstant_13 = OpTypePointer UniformConstant %13
+%v3float = OpTypeVector %float 3
+%float_0 = OpConstant %float 0
+%26 = OpConstantComposite %v3float %float_0 %float_0 %float_0
+%uint_0 = OpConstant %uint 0
+%_ptr_Function_float = OpTypePointer Function %float
+%main = OpFunction %void None %3
+%5 = OpLabel
+%36 = OpVariable %_ptr_Function_v4float Function
+%38 = OpAccessChain %_ptr_UniformConstant_13 %samplers %int_0
+%39 = OpLoad %13 %38
+%40 = OpImageSampleExplicitLod %v4float %39 %26 Lod %float_0
+OpStore %36 %40
+%41 = OpAccessChain %_ptr_Function_float %36 %uint_0
+%42 = OpLoad %float %41
+%43 = OpExtInst %void %33 1 %28 %42
+OpReturn
+OpFunctionEnd
+%foo_ = OpFunction %void None %3
+%7 = OpLabel
+%c = OpVariable %_ptr_Function_v4float Function
+%22 = OpAccessChain %_ptr_UniformConstant_13 %samplers %int_0
+%23 = OpLoad %13 %22
+%27 = OpImageSampleExplicitLod %v4float %23 %26 Lod %float_0
+OpStore %c %27
+%31 = OpAccessChain %_ptr_Function_float %c %uint_0
+%32 = OpLoad %float %31
+%34 = OpExtInst %void %33 1 %28 %32
+OpReturn
+OpFunctionEnd
+)";
+
+  SetTargetEnv(SPV_ENV_VULKAN_1_2);
+  SinglePassRunAndMatch<EliminateDeadFunctionsPass>(text, true);
+}
+
 }  // namespace
 }  // namespace opt
 }  // namespace spvtools