Enable various switch tests in ES2 mode.

switch is no longer an ES3-specific feature.

Change-Id: Ic878a77268e517e17699c2e35a37da6b0a7765dd
Bug: skia:12450
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/452320
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
This commit is contained in:
John Stiles 2021-12-02 10:14:34 -05:00 committed by SkCQ
parent 9d74c28e82
commit ffe365eb4d
11 changed files with 746 additions and 705 deletions

View File

@ -952,6 +952,7 @@ func (b *taskBuilder) dmFlags(internalHardwareLabel string) {
if b.gpu("Tegra3") { if b.gpu("Tegra3") {
// Tegra3 fails to compile break stmts inside a for loop (skia:12477) // Tegra3 fails to compile break stmts inside a for loop (skia:12477)
skip("_", "tests", "_", "SkSLReturnsValueOnEveryPathES2_GPU")
skip("_", "tests", "_", "SkSLSwitch_GPU") skip("_", "tests", "_", "SkSLSwitch_GPU")
skip("_", "tests", "_", "SkSLSwitchDefaultOnly_GPU") skip("_", "tests", "_", "SkSLSwitchDefaultOnly_GPU")
skip("_", "tests", "_", "SkSLSwitchWithFallthrough_GPU") skip("_", "tests", "_", "SkSLSwitchWithFallthrough_GPU")

View File

@ -36460,7 +36460,7 @@
"skia/infra/bots/run_recipe.py", "skia/infra/bots/run_recipe.py",
"${ISOLATED_OUTDIR}", "${ISOLATED_OUTDIR}",
"test", "test",
"{\"$kitchen\":{\"devshell\":true,\"git_auth\":true},\"buildbucket_build_id\":\"<(BUILDBUCKET_BUILD_ID)\",\"buildername\":\"Test-Android-Clang-Nexus7-GPU-Tegra3-arm-Debug-All-Android\",\"dm_flags\":\"[\\\"dm\\\",\\\"--nameByHash\\\",\\\"--key\\\",\\\"arch\\\",\\\"arm\\\",\\\"compiler\\\",\\\"Clang\\\",\\\"configuration\\\",\\\"Debug\\\",\\\"cpu_or_gpu\\\",\\\"GPU\\\",\\\"cpu_or_gpu_value\\\",\\\"Tegra3\\\",\\\"extra_config\\\",\\\"Android\\\",\\\"model\\\",\\\"Nexus7\\\",\\\"os\\\",\\\"Android\\\",\\\"style\\\",\\\"default\\\",\\\"--threads\\\",\\\"0\\\",\\\"--nocpu\\\",\\\"--config\\\",\\\"gles\\\",\\\"glesdft\\\",\\\"srgb-gles\\\",\\\"--src\\\",\\\"tests\\\",\\\"gm\\\",\\\"image\\\",\\\"colorImage\\\",\\\"svg\\\",\\\"--skip\\\",\\\"_\\\",\\\"test\\\",\\\"_\\\",\\\"ProcessorCloneTest\\\",\\\"_\\\",\\\"test\\\",\\\"_\\\",\\\"Programs\\\",\\\"_\\\",\\\"test\\\",\\\"_\\\",\\\"ProcessorOptimizationValidationTest\\\",\\\"_\\\",\\\"svg\\\",\\\"_\\\",\\\"svgparse_\\\",\\\"srgb-gles\\\",\\\"image\\\",\\\"_\\\",\\\"_\\\",\\\"_\\\",\\\"image\\\",\\\"gen_platf\\\",\\\"error\\\",\\\"_\\\",\\\"test\\\",\\\"_\\\",\\\"GrStyledShape\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\"interlaced1.png\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\"interlaced2.png\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\"interlaced3.png\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".arw\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".cr2\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".dng\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".nef\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".nrw\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".orf\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".raf\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".rw2\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".pef\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".srw\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".ARW\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".CR2\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".DNG\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".NEF\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".NRW\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".ORF\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".RAF\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".RW2\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".PEF\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".SRW\\\",\\\"_\\\",\\\"tests\\\",\\\"_\\\",\\\"SkSLSwitch_GPU\\\",\\\"_\\\",\\\"tests\\\",\\\"_\\\",\\\"SkSLSwitchDefaultOnly_GPU\\\",\\\"_\\\",\\\"tests\\\",\\\"_\\\",\\\"SkSLSwitchWithFallthrough_GPU\\\",\\\"_\\\",\\\"tests\\\",\\\"_\\\",\\\"SkSLSwitchWithLoops_GPU\\\",\\\"_\\\",\\\"tests\\\",\\\"_\\\",\\\"SkSLLoopFloat_GPU\\\",\\\"_\\\",\\\"tests\\\",\\\"_\\\",\\\"SkSLLoopInt_GPU\\\",\\\"_\\\",\\\"tests\\\",\\\"_\\\",\\\"SkSLMatrixConstructorsES2_GPU\\\",\\\"_\\\",\\\"tests\\\",\\\"_\\\",\\\"SkSLMatrixConstructorsES3_GPU\\\",\\\"--nonativeFonts\\\",\\\"--verbose\\\"]\",\"dm_properties\":\"{\\\"buildbucket_build_id\\\":\\\"<(BUILDBUCKET_BUILD_ID)\\\",\\\"builder\\\":\\\"Test-Android-Clang-Nexus7-GPU-Tegra3-arm-Debug-All-Android\\\",\\\"gitHash\\\":\\\"<(REVISION)\\\",\\\"issue\\\":\\\"<(ISSUE)\\\",\\\"patch_storage\\\":\\\"<(PATCH_STORAGE)\\\",\\\"patchset\\\":\\\"<(PATCHSET)\\\",\\\"swarming_bot_id\\\":\\\"${SWARMING_BOT_ID}\\\",\\\"swarming_task_id\\\":\\\"${SWARMING_TASK_ID}\\\",\\\"task_id\\\":\\\"<(TASK_ID)\\\"}\",\"do_upload\":\"true\",\"gold_hashes_url\":\"https://gold.skia.org/json/v1/hashes\",\"gs_bucket\":\"skia-infra-gm\",\"images\":\"true\",\"patch_issue\":\"<(ISSUE_INT)\",\"patch_ref\":\"<(PATCH_REF)\",\"patch_repo\":\"<(PATCH_REPO)\",\"patch_set\":\"<(PATCHSET_INT)\",\"patch_storage\":\"<(PATCH_STORAGE)\",\"repository\":\"<(REPO)\",\"resources\":\"true\",\"revision\":\"<(REVISION)\",\"skps\":\"true\",\"svgs\":\"true\",\"swarm_out_dir\":\"test\",\"task_id\":\"<(TASK_ID)\"}", "{\"$kitchen\":{\"devshell\":true,\"git_auth\":true},\"buildbucket_build_id\":\"<(BUILDBUCKET_BUILD_ID)\",\"buildername\":\"Test-Android-Clang-Nexus7-GPU-Tegra3-arm-Debug-All-Android\",\"dm_flags\":\"[\\\"dm\\\",\\\"--nameByHash\\\",\\\"--key\\\",\\\"arch\\\",\\\"arm\\\",\\\"compiler\\\",\\\"Clang\\\",\\\"configuration\\\",\\\"Debug\\\",\\\"cpu_or_gpu\\\",\\\"GPU\\\",\\\"cpu_or_gpu_value\\\",\\\"Tegra3\\\",\\\"extra_config\\\",\\\"Android\\\",\\\"model\\\",\\\"Nexus7\\\",\\\"os\\\",\\\"Android\\\",\\\"style\\\",\\\"default\\\",\\\"--threads\\\",\\\"0\\\",\\\"--nocpu\\\",\\\"--config\\\",\\\"gles\\\",\\\"glesdft\\\",\\\"srgb-gles\\\",\\\"--src\\\",\\\"tests\\\",\\\"gm\\\",\\\"image\\\",\\\"colorImage\\\",\\\"svg\\\",\\\"--skip\\\",\\\"_\\\",\\\"test\\\",\\\"_\\\",\\\"ProcessorCloneTest\\\",\\\"_\\\",\\\"test\\\",\\\"_\\\",\\\"Programs\\\",\\\"_\\\",\\\"test\\\",\\\"_\\\",\\\"ProcessorOptimizationValidationTest\\\",\\\"_\\\",\\\"svg\\\",\\\"_\\\",\\\"svgparse_\\\",\\\"srgb-gles\\\",\\\"image\\\",\\\"_\\\",\\\"_\\\",\\\"_\\\",\\\"image\\\",\\\"gen_platf\\\",\\\"error\\\",\\\"_\\\",\\\"test\\\",\\\"_\\\",\\\"GrStyledShape\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\"interlaced1.png\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\"interlaced2.png\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\"interlaced3.png\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".arw\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".cr2\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".dng\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".nef\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".nrw\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".orf\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".raf\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".rw2\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".pef\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".srw\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".ARW\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".CR2\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".DNG\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".NEF\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".NRW\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".ORF\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".RAF\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".RW2\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".PEF\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".SRW\\\",\\\"_\\\",\\\"tests\\\",\\\"_\\\",\\\"SkSLReturnsValueOnEveryPathES2_GPU\\\",\\\"_\\\",\\\"tests\\\",\\\"_\\\",\\\"SkSLSwitch_GPU\\\",\\\"_\\\",\\\"tests\\\",\\\"_\\\",\\\"SkSLSwitchDefaultOnly_GPU\\\",\\\"_\\\",\\\"tests\\\",\\\"_\\\",\\\"SkSLSwitchWithFallthrough_GPU\\\",\\\"_\\\",\\\"tests\\\",\\\"_\\\",\\\"SkSLSwitchWithLoops_GPU\\\",\\\"_\\\",\\\"tests\\\",\\\"_\\\",\\\"SkSLLoopFloat_GPU\\\",\\\"_\\\",\\\"tests\\\",\\\"_\\\",\\\"SkSLLoopInt_GPU\\\",\\\"_\\\",\\\"tests\\\",\\\"_\\\",\\\"SkSLMatrixConstructorsES2_GPU\\\",\\\"_\\\",\\\"tests\\\",\\\"_\\\",\\\"SkSLMatrixConstructorsES3_GPU\\\",\\\"--nonativeFonts\\\",\\\"--verbose\\\"]\",\"dm_properties\":\"{\\\"buildbucket_build_id\\\":\\\"<(BUILDBUCKET_BUILD_ID)\\\",\\\"builder\\\":\\\"Test-Android-Clang-Nexus7-GPU-Tegra3-arm-Debug-All-Android\\\",\\\"gitHash\\\":\\\"<(REVISION)\\\",\\\"issue\\\":\\\"<(ISSUE)\\\",\\\"patch_storage\\\":\\\"<(PATCH_STORAGE)\\\",\\\"patchset\\\":\\\"<(PATCHSET)\\\",\\\"swarming_bot_id\\\":\\\"${SWARMING_BOT_ID}\\\",\\\"swarming_task_id\\\":\\\"${SWARMING_TASK_ID}\\\",\\\"task_id\\\":\\\"<(TASK_ID)\\\"}\",\"do_upload\":\"true\",\"gold_hashes_url\":\"https://gold.skia.org/json/v1/hashes\",\"gs_bucket\":\"skia-infra-gm\",\"images\":\"true\",\"patch_issue\":\"<(ISSUE_INT)\",\"patch_ref\":\"<(PATCH_REF)\",\"patch_repo\":\"<(PATCH_REPO)\",\"patch_set\":\"<(PATCHSET_INT)\",\"patch_storage\":\"<(PATCH_STORAGE)\",\"repository\":\"<(REPO)\",\"resources\":\"true\",\"revision\":\"<(REVISION)\",\"skps\":\"true\",\"svgs\":\"true\",\"swarm_out_dir\":\"test\",\"task_id\":\"<(TASK_ID)\"}",
"skia" "skia"
], ],
"dependencies": [ "dependencies": [
@ -36559,7 +36559,7 @@
"skia/infra/bots/run_recipe.py", "skia/infra/bots/run_recipe.py",
"${ISOLATED_OUTDIR}", "${ISOLATED_OUTDIR}",
"test", "test",
"{\"$kitchen\":{\"devshell\":true,\"git_auth\":true},\"buildbucket_build_id\":\"<(BUILDBUCKET_BUILD_ID)\",\"buildername\":\"Test-Android-Clang-Nexus7-GPU-Tegra3-arm-Release-All-Android\",\"dm_flags\":\"[\\\"dm\\\",\\\"--nameByHash\\\",\\\"--key\\\",\\\"arch\\\",\\\"arm\\\",\\\"compiler\\\",\\\"Clang\\\",\\\"configuration\\\",\\\"Release\\\",\\\"cpu_or_gpu\\\",\\\"GPU\\\",\\\"cpu_or_gpu_value\\\",\\\"Tegra3\\\",\\\"extra_config\\\",\\\"Android\\\",\\\"model\\\",\\\"Nexus7\\\",\\\"os\\\",\\\"Android\\\",\\\"style\\\",\\\"default\\\",\\\"--threads\\\",\\\"0\\\",\\\"--nocpu\\\",\\\"--config\\\",\\\"gles\\\",\\\"glesdft\\\",\\\"srgb-gles\\\",\\\"--src\\\",\\\"tests\\\",\\\"gm\\\",\\\"image\\\",\\\"colorImage\\\",\\\"svg\\\",\\\"--skip\\\",\\\"_\\\",\\\"test\\\",\\\"_\\\",\\\"ProcessorCloneTest\\\",\\\"_\\\",\\\"test\\\",\\\"_\\\",\\\"Programs\\\",\\\"_\\\",\\\"test\\\",\\\"_\\\",\\\"ProcessorOptimizationValidationTest\\\",\\\"_\\\",\\\"svg\\\",\\\"_\\\",\\\"svgparse_\\\",\\\"srgb-gles\\\",\\\"image\\\",\\\"_\\\",\\\"_\\\",\\\"_\\\",\\\"image\\\",\\\"gen_platf\\\",\\\"error\\\",\\\"_\\\",\\\"test\\\",\\\"_\\\",\\\"GrStyledShape\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\"interlaced1.png\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\"interlaced2.png\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\"interlaced3.png\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".arw\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".cr2\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".dng\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".nef\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".nrw\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".orf\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".raf\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".rw2\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".pef\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".srw\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".ARW\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".CR2\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".DNG\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".NEF\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".NRW\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".ORF\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".RAF\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".RW2\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".PEF\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".SRW\\\",\\\"_\\\",\\\"tests\\\",\\\"_\\\",\\\"SkSLSwitch_GPU\\\",\\\"_\\\",\\\"tests\\\",\\\"_\\\",\\\"SkSLSwitchDefaultOnly_GPU\\\",\\\"_\\\",\\\"tests\\\",\\\"_\\\",\\\"SkSLSwitchWithFallthrough_GPU\\\",\\\"_\\\",\\\"tests\\\",\\\"_\\\",\\\"SkSLSwitchWithLoops_GPU\\\",\\\"_\\\",\\\"tests\\\",\\\"_\\\",\\\"SkSLLoopFloat_GPU\\\",\\\"_\\\",\\\"tests\\\",\\\"_\\\",\\\"SkSLLoopInt_GPU\\\",\\\"_\\\",\\\"tests\\\",\\\"_\\\",\\\"SkSLMatrixConstructorsES2_GPU\\\",\\\"_\\\",\\\"tests\\\",\\\"_\\\",\\\"SkSLMatrixConstructorsES3_GPU\\\",\\\"--nonativeFonts\\\",\\\"--verbose\\\"]\",\"dm_properties\":\"{\\\"buildbucket_build_id\\\":\\\"<(BUILDBUCKET_BUILD_ID)\\\",\\\"builder\\\":\\\"Test-Android-Clang-Nexus7-GPU-Tegra3-arm-Release-All-Android\\\",\\\"gitHash\\\":\\\"<(REVISION)\\\",\\\"issue\\\":\\\"<(ISSUE)\\\",\\\"patch_storage\\\":\\\"<(PATCH_STORAGE)\\\",\\\"patchset\\\":\\\"<(PATCHSET)\\\",\\\"swarming_bot_id\\\":\\\"${SWARMING_BOT_ID}\\\",\\\"swarming_task_id\\\":\\\"${SWARMING_TASK_ID}\\\",\\\"task_id\\\":\\\"<(TASK_ID)\\\"}\",\"do_upload\":\"true\",\"gold_hashes_url\":\"https://gold.skia.org/json/v1/hashes\",\"gs_bucket\":\"skia-infra-gm\",\"images\":\"true\",\"patch_issue\":\"<(ISSUE_INT)\",\"patch_ref\":\"<(PATCH_REF)\",\"patch_repo\":\"<(PATCH_REPO)\",\"patch_set\":\"<(PATCHSET_INT)\",\"patch_storage\":\"<(PATCH_STORAGE)\",\"repository\":\"<(REPO)\",\"resources\":\"true\",\"revision\":\"<(REVISION)\",\"skps\":\"true\",\"svgs\":\"true\",\"swarm_out_dir\":\"test\",\"task_id\":\"<(TASK_ID)\"}", "{\"$kitchen\":{\"devshell\":true,\"git_auth\":true},\"buildbucket_build_id\":\"<(BUILDBUCKET_BUILD_ID)\",\"buildername\":\"Test-Android-Clang-Nexus7-GPU-Tegra3-arm-Release-All-Android\",\"dm_flags\":\"[\\\"dm\\\",\\\"--nameByHash\\\",\\\"--key\\\",\\\"arch\\\",\\\"arm\\\",\\\"compiler\\\",\\\"Clang\\\",\\\"configuration\\\",\\\"Release\\\",\\\"cpu_or_gpu\\\",\\\"GPU\\\",\\\"cpu_or_gpu_value\\\",\\\"Tegra3\\\",\\\"extra_config\\\",\\\"Android\\\",\\\"model\\\",\\\"Nexus7\\\",\\\"os\\\",\\\"Android\\\",\\\"style\\\",\\\"default\\\",\\\"--threads\\\",\\\"0\\\",\\\"--nocpu\\\",\\\"--config\\\",\\\"gles\\\",\\\"glesdft\\\",\\\"srgb-gles\\\",\\\"--src\\\",\\\"tests\\\",\\\"gm\\\",\\\"image\\\",\\\"colorImage\\\",\\\"svg\\\",\\\"--skip\\\",\\\"_\\\",\\\"test\\\",\\\"_\\\",\\\"ProcessorCloneTest\\\",\\\"_\\\",\\\"test\\\",\\\"_\\\",\\\"Programs\\\",\\\"_\\\",\\\"test\\\",\\\"_\\\",\\\"ProcessorOptimizationValidationTest\\\",\\\"_\\\",\\\"svg\\\",\\\"_\\\",\\\"svgparse_\\\",\\\"srgb-gles\\\",\\\"image\\\",\\\"_\\\",\\\"_\\\",\\\"_\\\",\\\"image\\\",\\\"gen_platf\\\",\\\"error\\\",\\\"_\\\",\\\"test\\\",\\\"_\\\",\\\"GrStyledShape\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\"interlaced1.png\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\"interlaced2.png\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\"interlaced3.png\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".arw\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".cr2\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".dng\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".nef\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".nrw\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".orf\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".raf\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".rw2\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".pef\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".srw\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".ARW\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".CR2\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".DNG\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".NEF\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".NRW\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".ORF\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".RAF\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".RW2\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".PEF\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".SRW\\\",\\\"_\\\",\\\"tests\\\",\\\"_\\\",\\\"SkSLReturnsValueOnEveryPathES2_GPU\\\",\\\"_\\\",\\\"tests\\\",\\\"_\\\",\\\"SkSLSwitch_GPU\\\",\\\"_\\\",\\\"tests\\\",\\\"_\\\",\\\"SkSLSwitchDefaultOnly_GPU\\\",\\\"_\\\",\\\"tests\\\",\\\"_\\\",\\\"SkSLSwitchWithFallthrough_GPU\\\",\\\"_\\\",\\\"tests\\\",\\\"_\\\",\\\"SkSLSwitchWithLoops_GPU\\\",\\\"_\\\",\\\"tests\\\",\\\"_\\\",\\\"SkSLLoopFloat_GPU\\\",\\\"_\\\",\\\"tests\\\",\\\"_\\\",\\\"SkSLLoopInt_GPU\\\",\\\"_\\\",\\\"tests\\\",\\\"_\\\",\\\"SkSLMatrixConstructorsES2_GPU\\\",\\\"_\\\",\\\"tests\\\",\\\"_\\\",\\\"SkSLMatrixConstructorsES3_GPU\\\",\\\"--nonativeFonts\\\",\\\"--verbose\\\"]\",\"dm_properties\":\"{\\\"buildbucket_build_id\\\":\\\"<(BUILDBUCKET_BUILD_ID)\\\",\\\"builder\\\":\\\"Test-Android-Clang-Nexus7-GPU-Tegra3-arm-Release-All-Android\\\",\\\"gitHash\\\":\\\"<(REVISION)\\\",\\\"issue\\\":\\\"<(ISSUE)\\\",\\\"patch_storage\\\":\\\"<(PATCH_STORAGE)\\\",\\\"patchset\\\":\\\"<(PATCHSET)\\\",\\\"swarming_bot_id\\\":\\\"${SWARMING_BOT_ID}\\\",\\\"swarming_task_id\\\":\\\"${SWARMING_TASK_ID}\\\",\\\"task_id\\\":\\\"<(TASK_ID)\\\"}\",\"do_upload\":\"true\",\"gold_hashes_url\":\"https://gold.skia.org/json/v1/hashes\",\"gs_bucket\":\"skia-infra-gm\",\"images\":\"true\",\"patch_issue\":\"<(ISSUE_INT)\",\"patch_ref\":\"<(PATCH_REF)\",\"patch_repo\":\"<(PATCH_REPO)\",\"patch_set\":\"<(PATCHSET_INT)\",\"patch_storage\":\"<(PATCH_STORAGE)\",\"repository\":\"<(REPO)\",\"resources\":\"true\",\"revision\":\"<(REVISION)\",\"skps\":\"true\",\"svgs\":\"true\",\"swarm_out_dir\":\"test\",\"task_id\":\"<(TASK_ID)\"}",
"skia" "skia"
], ],
"dependencies": [ "dependencies": [

View File

@ -37,11 +37,77 @@ bool if_else_chain() {
return true; return true;
} }
bool switch_with_all_returns() {
switch (int(unknownInput)) {
case 1: return true;
case 2: return true;
default: return true;
}
}
bool switch_only_default() {
switch (int(unknownInput)) {
default: return true;
}
}
bool switch_fallthrough() {
switch (int(unknownInput)) {
case 1: return true;
case 2:
default: return true;
}
}
bool switch_fallthrough_twice() {
switch (int(unknownInput)) {
case 1:
case 2:
default: return true;
}
}
bool switch_with_break_in_loop() {
switch (int(unknownInput)) {
case 1: for (int x=0; x<=10; ++x) { break; }
default: return true;
}
}
bool switch_with_continue_in_loop() {
switch (int(unknownInput)) {
case 1: for (int x=0; x<=10; ++x) { continue; }
default: return true;
}
}
bool switch_with_if_that_returns() {
switch (int(unknownInput)) {
case 1: if (unknownInput == 123) return true; else return true;
default: return true;
}
}
bool switch_with_one_sided_if_then_fallthrough() {
switch (int(unknownInput)) {
case 1: if (unknownInput == 123) return true;
default: return true;
}
}
half4 main(float2 coords) { half4 main(float2 coords) {
return simple() && return simple() &&
return_on_both_sides() && return_on_both_sides() &&
for_inside_body() && for_inside_body() &&
after_for_body() && after_for_body() &&
for_with_double_sided_conditional_return() && for_with_double_sided_conditional_return() &&
if_else_chain() ? colorGreen : colorRed; if_else_chain() &&
switch_with_all_returns() &&
switch_only_default() &&
switch_fallthrough() &&
switch_fallthrough_twice() &&
switch_with_break_in_loop() &&
switch_with_continue_in_loop() &&
switch_with_if_that_returns() &&
switch_with_one_sided_if_then_fallthrough() ? colorGreen : colorRed;
} }

View File

@ -34,69 +34,10 @@ bool after_while_loop() {
return true; return true;
} }
bool switch_with_all_returns() {
switch (int(unknownInput)) {
case 1: return true;
case 2: return false;
default: return false;
}
}
bool switch_fallthrough() {
switch (int(unknownInput)) {
case 1: return true;
case 2:
default: return false;
}
}
bool switch_fallthrough_twice() {
switch (int(unknownInput)) {
case 1:
case 2:
default: return true;
}
}
bool switch_with_break_in_loop() {
switch (int(unknownInput)) {
case 1: for (int x=0; x<=10; ++x) { break; }
default: return true;
}
}
bool switch_with_continue_in_loop() {
switch (int(unknownInput)) {
case 1: for (int x=0; x<=10; ++x) { continue; }
default: return true;
}
}
bool switch_with_if_that_returns() {
switch (int(unknownInput)) {
case 1: if (unknownInput == 123) return false; else return true;
default: return true;
}
}
bool switch_with_one_sided_if_then_fallthrough() {
switch (int(unknownInput)) {
case 1: if (unknownInput == 123) return false;
default: return true;
}
}
half4 main(float2 coords) { half4 main(float2 coords) {
return inside_while_loop() && return inside_while_loop() &&
inside_infinite_do_loop() && inside_infinite_do_loop() &&
inside_infinite_while_loop() && inside_infinite_while_loop() &&
after_do_loop() && after_do_loop() &&
after_while_loop() && after_while_loop() ? colorGreen : colorRed;
switch_with_all_returns() &&
switch_fallthrough() &&
switch_fallthrough_twice() &&
switch_with_break_in_loop() &&
switch_with_continue_in_loop() &&
switch_with_if_that_returns() &&
switch_with_one_sided_if_then_fallthrough() ? colorGreen : colorRed;
} }

View File

@ -238,7 +238,7 @@ SKSL_TEST(SkSLInlineWithUnnecessaryBlocks, "inliner/InlineWithUnnecessary
SKSL_TEST(SkSLNoInline, "inliner/NoInline.sksl") SKSL_TEST(SkSLNoInline, "inliner/NoInline.sksl")
SKSL_TEST(SkSLShortCircuitEvaluationsCannotInlineRightHandSide, SKSL_TEST(SkSLShortCircuitEvaluationsCannotInlineRightHandSide,
"inliner/ShortCircuitEvaluationsCannotInlineRightHandSide.sksl") "inliner/ShortCircuitEvaluationsCannotInlineRightHandSide.sksl")
SKSL_TEST_ES3(SkSLStaticSwitchInline, "inliner/StaticSwitch.sksl") SKSL_TEST(SkSLStaticSwitchInline, "inliner/StaticSwitch.sksl")
SKSL_TEST(SkSLStructsCanBeInlinedSafely, "inliner/StructsCanBeInlinedSafely.sksl") SKSL_TEST(SkSLStructsCanBeInlinedSafely, "inliner/StructsCanBeInlinedSafely.sksl")
SKSL_TEST(SkSLSwizzleCanBeInlinedDirectly, "inliner/SwizzleCanBeInlinedDirectly.sksl") SKSL_TEST(SkSLSwizzleCanBeInlinedDirectly, "inliner/SwizzleCanBeInlinedDirectly.sksl")
SKSL_TEST(SkSLTernaryResultsCannotBeInlined, "inliner/TernaryResultsCannotBeInlined.sksl") SKSL_TEST(SkSLTernaryResultsCannotBeInlined, "inliner/TernaryResultsCannotBeInlined.sksl")
@ -353,7 +353,7 @@ SKSL_TEST(SkSLScopedSymbol, "shared/ScopedSymbol.sksl")
SKSL_TEST_ES3(SkSLScalarConversionConstructorsES3, "shared/ScalarConversionConstructorsES3.sksl") SKSL_TEST_ES3(SkSLScalarConversionConstructorsES3, "shared/ScalarConversionConstructorsES3.sksl")
SKSL_TEST(SkSLStackingVectorCasts, "shared/StackingVectorCasts.sksl") SKSL_TEST(SkSLStackingVectorCasts, "shared/StackingVectorCasts.sksl")
SKSL_TEST(SkSLStaticIf, "shared/StaticIf.sksl") SKSL_TEST(SkSLStaticIf, "shared/StaticIf.sksl")
SKSL_TEST_ES3(SkSLStaticSwitch, "shared/StaticSwitch.sksl") SKSL_TEST(SkSLStaticSwitch, "shared/StaticSwitch.sksl")
SKSL_TEST(SkSLStructArrayFollowedByScalar, "shared/StructArrayFollowedByScalar.sksl") SKSL_TEST(SkSLStructArrayFollowedByScalar, "shared/StructArrayFollowedByScalar.sksl")
SKSL_TEST(SkSLStructsInFunctions, "shared/StructsInFunctions.sksl") SKSL_TEST(SkSLStructsInFunctions, "shared/StructsInFunctions.sksl")
SKSL_TEST(SkSLSwitch, "shared/Switch.sksl") SKSL_TEST(SkSLSwitch, "shared/Switch.sksl")

View File

@ -18,6 +18,16 @@ OpName %x_0 "x"
OpName %for_with_double_sided_conditional_return_b "for_with_double_sided_conditional_return_b" OpName %for_with_double_sided_conditional_return_b "for_with_double_sided_conditional_return_b"
OpName %x_1 "x" OpName %x_1 "x"
OpName %if_else_chain_b "if_else_chain_b" OpName %if_else_chain_b "if_else_chain_b"
OpName %switch_with_all_returns_b "switch_with_all_returns_b"
OpName %switch_only_default_b "switch_only_default_b"
OpName %switch_fallthrough_b "switch_fallthrough_b"
OpName %switch_fallthrough_twice_b "switch_fallthrough_twice_b"
OpName %switch_with_break_in_loop_b "switch_with_break_in_loop_b"
OpName %x_2 "x"
OpName %switch_with_continue_in_loop_b "switch_with_continue_in_loop_b"
OpName %x_3 "x"
OpName %switch_with_if_that_returns_b "switch_with_if_that_returns_b"
OpName %switch_with_one_sided_if_then_fallthrough_b "switch_with_one_sided_if_then_fallthrough_b"
OpName %main "main" OpName %main "main"
OpDecorate %sk_FragColor RelaxedPrecision OpDecorate %sk_FragColor RelaxedPrecision
OpDecorate %sk_FragColor Location 0 OpDecorate %sk_FragColor Location 0
@ -30,17 +40,27 @@ OpMemberDecorate %_UniformBuffer 1 RelaxedPrecision
OpMemberDecorate %_UniformBuffer 2 Offset 32 OpMemberDecorate %_UniformBuffer 2 Offset 32
OpMemberDecorate %_UniformBuffer 2 RelaxedPrecision OpMemberDecorate %_UniformBuffer 2 RelaxedPrecision
OpDecorate %_UniformBuffer Block OpDecorate %_UniformBuffer Block
OpDecorate %15 Binding 0 OpDecorate %23 Binding 0
OpDecorate %15 DescriptorSet 0 OpDecorate %23 DescriptorSet 0
OpDecorate %34 RelaxedPrecision OpDecorate %42 RelaxedPrecision
OpDecorate %77 RelaxedPrecision OpDecorate %85 RelaxedPrecision
OpDecorate %86 RelaxedPrecision OpDecorate %94 RelaxedPrecision
OpDecorate %92 RelaxedPrecision
OpDecorate %100 RelaxedPrecision OpDecorate %100 RelaxedPrecision
OpDecorate %107 RelaxedPrecision OpDecorate %108 RelaxedPrecision
OpDecorate %143 RelaxedPrecision OpDecorate %115 RelaxedPrecision
OpDecorate %123 RelaxedPrecision
OpDecorate %131 RelaxedPrecision
OpDecorate %137 RelaxedPrecision
OpDecorate %145 RelaxedPrecision OpDecorate %145 RelaxedPrecision
OpDecorate %146 RelaxedPrecision OpDecorate %153 RelaxedPrecision
OpDecorate %170 RelaxedPrecision
OpDecorate %187 RelaxedPrecision
OpDecorate %193 RelaxedPrecision
OpDecorate %201 RelaxedPrecision
OpDecorate %207 RelaxedPrecision
OpDecorate %273 RelaxedPrecision
OpDecorate %275 RelaxedPrecision
OpDecorate %276 RelaxedPrecision
%float = OpTypeFloat 32 %float = OpTypeFloat 32
%v4float = OpTypeVector %float 4 %v4float = OpTypeVector %float 4
%_ptr_Output_v4float = OpTypePointer Output %v4float %_ptr_Output_v4float = OpTypePointer Output %v4float
@ -50,14 +70,14 @@ OpDecorate %146 RelaxedPrecision
%sk_Clockwise = OpVariable %_ptr_Input_bool Input %sk_Clockwise = OpVariable %_ptr_Input_bool Input
%_UniformBuffer = OpTypeStruct %v4float %v4float %float %_UniformBuffer = OpTypeStruct %v4float %v4float %float
%_ptr_Uniform__UniformBuffer = OpTypePointer Uniform %_UniformBuffer %_ptr_Uniform__UniformBuffer = OpTypePointer Uniform %_UniformBuffer
%15 = OpVariable %_ptr_Uniform__UniformBuffer Uniform %23 = OpVariable %_ptr_Uniform__UniformBuffer Uniform
%void = OpTypeVoid %void = OpTypeVoid
%20 = OpTypeFunction %void %28 = OpTypeFunction %void
%v2float = OpTypeVector %float 2 %v2float = OpTypeVector %float 2
%float_0 = OpConstant %float 0 %float_0 = OpConstant %float 0
%24 = OpConstantComposite %v2float %float_0 %float_0 %32 = OpConstantComposite %v2float %float_0 %float_0
%_ptr_Function_v2float = OpTypePointer Function %v2float %_ptr_Function_v2float = OpTypePointer Function %v2float
%28 = OpTypeFunction %bool %36 = OpTypeFunction %bool
%_ptr_Uniform_float = OpTypePointer Uniform %float %_ptr_Uniform_float = OpTypePointer Uniform %float
%int = OpTypeInt 32 1 %int = OpTypeInt 32 1
%int_2 = OpConstant %int 2 %int_2 = OpConstant %int 2
@ -71,203 +91,430 @@ OpDecorate %146 RelaxedPrecision
%false = OpConstantFalse %bool %false = OpConstantFalse %bool
%float_3 = OpConstant %float 3 %float_3 = OpConstant %float 3
%float_4 = OpConstant %float 4 %float_4 = OpConstant %float 4
%113 = OpTypeFunction %v4float %_ptr_Function_v2float %float_123 = OpConstant %float 123
%211 = OpTypeFunction %v4float %_ptr_Function_v2float
%_ptr_Function_v4float = OpTypePointer Function %v4float %_ptr_Function_v4float = OpTypePointer Function %v4float
%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float %_ptr_Uniform_v4float = OpTypePointer Uniform %v4float
%_entrypoint_v = OpFunction %void None %20 %_entrypoint_v = OpFunction %void None %28
%21 = OpLabel %29 = OpLabel
%25 = OpVariable %_ptr_Function_v2float Function %33 = OpVariable %_ptr_Function_v2float Function
OpStore %25 %24 OpStore %33 %32
%27 = OpFunctionCall %v4float %main %25 %35 = OpFunctionCall %v4float %main %33
OpStore %sk_FragColor %27 OpStore %sk_FragColor %35
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%return_on_both_sides_b = OpFunction %bool None %28 %return_on_both_sides_b = OpFunction %bool None %36
%29 = OpLabel
%30 = OpAccessChain %_ptr_Uniform_float %15 %int_2
%34 = OpLoad %float %30
%36 = OpFOrdEqual %bool %34 %float_1
OpSelectionMerge %39 None
OpBranchConditional %36 %37 %38
%37 = OpLabel %37 = OpLabel
%38 = OpAccessChain %_ptr_Uniform_float %23 %int_2
%42 = OpLoad %float %38
%44 = OpFOrdEqual %bool %42 %float_1
OpSelectionMerge %47 None
OpBranchConditional %44 %45 %46
%45 = OpLabel
OpReturnValue %true OpReturnValue %true
%38 = OpLabel %46 = OpLabel
OpReturnValue %true OpReturnValue %true
%39 = OpLabel %47 = OpLabel
OpUnreachable OpUnreachable
OpFunctionEnd OpFunctionEnd
%for_inside_body_b = OpFunction %bool None %28 %for_inside_body_b = OpFunction %bool None %36
%41 = OpLabel %49 = OpLabel
%x = OpVariable %_ptr_Function_int Function %x = OpVariable %_ptr_Function_int Function
OpStore %x %int_0 OpStore %x %int_0
OpBranch %45 OpBranch %53
%45 = OpLabel %53 = OpLabel
OpLoopMerge %49 %48 None OpLoopMerge %57 %56 None
OpBranch %46 OpBranch %54
%46 = OpLabel %54 = OpLabel
%50 = OpLoad %int %x %58 = OpLoad %int %x
%52 = OpSLessThanEqual %bool %50 %int_10 %60 = OpSLessThanEqual %bool %58 %int_10
OpBranchConditional %52 %47 %49 OpBranchConditional %60 %55 %57
%47 = OpLabel %55 = OpLabel
OpReturnValue %true OpReturnValue %true
%48 = OpLabel %56 = OpLabel
%54 = OpLoad %int %x %62 = OpLoad %int %x
%55 = OpIAdd %int %54 %int_1 %63 = OpIAdd %int %62 %int_1
OpStore %x %55 OpStore %x %63
OpBranch %45 OpBranch %53
%49 = OpLabel %57 = OpLabel
OpUnreachable OpUnreachable
OpFunctionEnd OpFunctionEnd
%after_for_body_b = OpFunction %bool None %28 %after_for_body_b = OpFunction %bool None %36
%56 = OpLabel %64 = OpLabel
%x_0 = OpVariable %_ptr_Function_int Function %x_0 = OpVariable %_ptr_Function_int Function
OpStore %x_0 %int_0 OpStore %x_0 %int_0
OpBranch %58 OpBranch %66
%58 = OpLabel %66 = OpLabel
OpLoopMerge %62 %61 None OpLoopMerge %70 %69 None
OpBranch %59 OpBranch %67
%59 = OpLabel
%63 = OpLoad %int %x_0
%64 = OpSLessThanEqual %bool %63 %int_10
OpBranchConditional %64 %60 %62
%60 = OpLabel
OpBranch %61
%61 = OpLabel
%65 = OpLoad %int %x_0
%66 = OpIAdd %int %65 %int_1
OpStore %x_0 %66
OpBranch %58
%62 = OpLabel
OpReturnValue %true
OpFunctionEnd
%for_with_double_sided_conditional_return_b = OpFunction %bool None %28
%67 = OpLabel %67 = OpLabel
%x_1 = OpVariable %_ptr_Function_int Function %71 = OpLoad %int %x_0
OpStore %x_1 %int_0 %72 = OpSLessThanEqual %bool %71 %int_10
OpBranchConditional %72 %68 %70
%68 = OpLabel
OpBranch %69 OpBranch %69
%69 = OpLabel %69 = OpLabel
OpLoopMerge %73 %72 None %73 = OpLoad %int %x_0
OpBranch %70 %74 = OpIAdd %int %73 %int_1
OpStore %x_0 %74
OpBranch %66
%70 = OpLabel %70 = OpLabel
%74 = OpLoad %int %x_1
%75 = OpSLessThanEqual %bool %74 %int_10
OpBranchConditional %75 %71 %73
%71 = OpLabel
%76 = OpAccessChain %_ptr_Uniform_float %15 %int_2
%77 = OpLoad %float %76
%78 = OpFOrdEqual %bool %77 %float_1
OpSelectionMerge %81 None
OpBranchConditional %78 %79 %80
%79 = OpLabel
OpReturnValue %true OpReturnValue %true
%80 = OpLabel
OpReturnValue %true
%81 = OpLabel
OpBranch %72
%72 = OpLabel
%82 = OpLoad %int %x_1
%83 = OpIAdd %int %82 %int_1
OpStore %x_1 %83
OpBranch %69
%73 = OpLabel
OpUnreachable
OpFunctionEnd OpFunctionEnd
%if_else_chain_b = OpFunction %bool None %28 %for_with_double_sided_conditional_return_b = OpFunction %bool None %36
%84 = OpLabel %75 = OpLabel
%85 = OpAccessChain %_ptr_Uniform_float %15 %int_2 %x_1 = OpVariable %_ptr_Function_int Function
%86 = OpLoad %float %85 OpStore %x_1 %int_0
%87 = OpFOrdEqual %bool %86 %float_1 OpBranch %77
OpSelectionMerge %90 None %77 = OpLabel
OpBranchConditional %87 %88 %89 OpLoopMerge %81 %80 None
OpBranch %78
%78 = OpLabel
%82 = OpLoad %int %x_1
%83 = OpSLessThanEqual %bool %82 %int_10
OpBranchConditional %83 %79 %81
%79 = OpLabel
%84 = OpAccessChain %_ptr_Uniform_float %23 %int_2
%85 = OpLoad %float %84
%86 = OpFOrdEqual %bool %85 %float_1
OpSelectionMerge %89 None
OpBranchConditional %86 %87 %88
%87 = OpLabel
OpReturnValue %true
%88 = OpLabel %88 = OpLabel
OpReturnValue %true OpReturnValue %true
%89 = OpLabel %89 = OpLabel
%91 = OpAccessChain %_ptr_Uniform_float %15 %int_2 OpBranch %80
%92 = OpLoad %float %91 %80 = OpLabel
%94 = OpFOrdEqual %bool %92 %float_2 %90 = OpLoad %int %x_1
OpSelectionMerge %97 None %91 = OpIAdd %int %90 %int_1
OpBranchConditional %94 %95 %96 OpStore %x_1 %91
%95 = OpLabel OpBranch %77
OpReturnValue %false %81 = OpLabel
OpUnreachable
OpFunctionEnd
%if_else_chain_b = OpFunction %bool None %36
%92 = OpLabel
%93 = OpAccessChain %_ptr_Uniform_float %23 %int_2
%94 = OpLoad %float %93
%95 = OpFOrdEqual %bool %94 %float_1
OpSelectionMerge %98 None
OpBranchConditional %95 %96 %97
%96 = OpLabel %96 = OpLabel
%99 = OpAccessChain %_ptr_Uniform_float %15 %int_2 OpReturnValue %true
%97 = OpLabel
%99 = OpAccessChain %_ptr_Uniform_float %23 %int_2
%100 = OpLoad %float %99 %100 = OpLoad %float %99
%102 = OpFOrdEqual %bool %100 %float_3 %102 = OpFOrdEqual %bool %100 %float_2
OpSelectionMerge %105 None OpSelectionMerge %105 None
OpBranchConditional %102 %103 %104 OpBranchConditional %102 %103 %104
%103 = OpLabel %103 = OpLabel
OpReturnValue %true
%104 = OpLabel
%106 = OpAccessChain %_ptr_Uniform_float %15 %int_2
%107 = OpLoad %float %106
%109 = OpFOrdEqual %bool %107 %float_4
OpSelectionMerge %112 None
OpBranchConditional %109 %110 %111
%110 = OpLabel
OpReturnValue %false OpReturnValue %false
%104 = OpLabel
%107 = OpAccessChain %_ptr_Uniform_float %23 %int_2
%108 = OpLoad %float %107
%110 = OpFOrdEqual %bool %108 %float_3
OpSelectionMerge %113 None
OpBranchConditional %110 %111 %112
%111 = OpLabel %111 = OpLabel
OpReturnValue %true OpReturnValue %true
%112 = OpLabel %112 = OpLabel
%114 = OpAccessChain %_ptr_Uniform_float %23 %int_2
%115 = OpLoad %float %114
%117 = OpFOrdEqual %bool %115 %float_4
OpSelectionMerge %120 None
OpBranchConditional %117 %118 %119
%118 = OpLabel
OpReturnValue %false
%119 = OpLabel
OpReturnValue %true
%120 = OpLabel
OpBranch %113
%113 = OpLabel
OpBranch %105 OpBranch %105
%105 = OpLabel %105 = OpLabel
OpBranch %97 OpBranch %98
%97 = OpLabel %98 = OpLabel
OpBranch %90
%90 = OpLabel
OpUnreachable OpUnreachable
OpFunctionEnd OpFunctionEnd
%main = OpFunction %v4float None %113 %switch_with_all_returns_b = OpFunction %bool None %36
%114 = OpFunctionParameter %_ptr_Function_v2float
%115 = OpLabel
%136 = OpVariable %_ptr_Function_v4float Function
OpSelectionMerge %117 None
OpBranchConditional %true %116 %117
%116 = OpLabel
%118 = OpFunctionCall %bool %return_on_both_sides_b
OpBranch %117
%117 = OpLabel
%119 = OpPhi %bool %false %115 %118 %116
OpSelectionMerge %121 None
OpBranchConditional %119 %120 %121
%120 = OpLabel
%122 = OpFunctionCall %bool %for_inside_body_b
OpBranch %121
%121 = OpLabel %121 = OpLabel
%123 = OpPhi %bool %false %117 %122 %120 %122 = OpAccessChain %_ptr_Uniform_float %23 %int_2
%123 = OpLoad %float %122
%124 = OpConvertFToS %int %123
OpSelectionMerge %125 None OpSelectionMerge %125 None
OpBranchConditional %123 %124 %125 OpSwitch %124 %128 1 %126 2 %127
%124 = OpLabel %126 = OpLabel
%126 = OpFunctionCall %bool %after_for_body_b OpReturnValue %true
OpBranch %125 %127 = OpLabel
%125 = OpLabel OpReturnValue %true
%127 = OpPhi %bool %false %121 %126 %124
OpSelectionMerge %129 None
OpBranchConditional %127 %128 %129
%128 = OpLabel %128 = OpLabel
%130 = OpFunctionCall %bool %for_with_double_sided_conditional_return_b OpReturnValue %true
OpBranch %129 %125 = OpLabel
%129 = OpLabel OpUnreachable
%131 = OpPhi %bool %false %125 %130 %128 OpFunctionEnd
OpSelectionMerge %133 None %switch_only_default_b = OpFunction %bool None %36
OpBranchConditional %131 %132 %133 %129 = OpLabel
%132 = OpLabel %130 = OpAccessChain %_ptr_Uniform_float %23 %int_2
%134 = OpFunctionCall %bool %if_else_chain_b %131 = OpLoad %float %130
OpBranch %133 %132 = OpConvertFToS %int %131
%133 = OpLabel OpSelectionMerge %133 None
%135 = OpPhi %bool %false %129 %134 %132 OpSwitch %132 %134
OpSelectionMerge %140 None %134 = OpLabel
OpBranchConditional %135 %138 %139 OpReturnValue %true
%138 = OpLabel %133 = OpLabel
%141 = OpAccessChain %_ptr_Uniform_v4float %15 %int_0 OpUnreachable
%143 = OpLoad %v4float %141 OpFunctionEnd
OpStore %136 %143 %switch_fallthrough_b = OpFunction %bool None %36
OpBranch %140 %135 = OpLabel
%139 = OpLabel %136 = OpAccessChain %_ptr_Uniform_float %23 %int_2
%144 = OpAccessChain %_ptr_Uniform_v4float %15 %int_1 %137 = OpLoad %float %136
%145 = OpLoad %v4float %144 %138 = OpConvertFToS %int %137
OpStore %136 %145 OpSelectionMerge %139 None
OpBranch %140 OpSwitch %138 %142 1 %140 2 %141
%140 = OpLabel %140 = OpLabel
%146 = OpLoad %v4float %136 OpReturnValue %true
OpReturnValue %146 %141 = OpLabel
OpBranch %142
%142 = OpLabel
OpReturnValue %true
%139 = OpLabel
OpUnreachable
OpFunctionEnd
%switch_fallthrough_twice_b = OpFunction %bool None %36
%143 = OpLabel
%144 = OpAccessChain %_ptr_Uniform_float %23 %int_2
%145 = OpLoad %float %144
%146 = OpConvertFToS %int %145
OpSelectionMerge %147 None
OpSwitch %146 %150 1 %148 2 %149
%148 = OpLabel
OpBranch %149
%149 = OpLabel
OpBranch %150
%150 = OpLabel
OpReturnValue %true
%147 = OpLabel
OpUnreachable
OpFunctionEnd
%switch_with_break_in_loop_b = OpFunction %bool None %36
%151 = OpLabel
%x_2 = OpVariable %_ptr_Function_int Function
%152 = OpAccessChain %_ptr_Uniform_float %23 %int_2
%153 = OpLoad %float %152
%154 = OpConvertFToS %int %153
OpSelectionMerge %155 None
OpSwitch %154 %157 1 %156
%156 = OpLabel
OpStore %x_2 %int_0
OpBranch %159
%159 = OpLabel
OpLoopMerge %163 %162 None
OpBranch %160
%160 = OpLabel
%164 = OpLoad %int %x_2
%165 = OpSLessThanEqual %bool %164 %int_10
OpBranchConditional %165 %161 %163
%161 = OpLabel
OpBranch %163
%162 = OpLabel
%166 = OpLoad %int %x_2
%167 = OpIAdd %int %166 %int_1
OpStore %x_2 %167
OpBranch %159
%163 = OpLabel
OpBranch %157
%157 = OpLabel
OpReturnValue %true
%155 = OpLabel
OpUnreachable
OpFunctionEnd
%switch_with_continue_in_loop_b = OpFunction %bool None %36
%168 = OpLabel
%x_3 = OpVariable %_ptr_Function_int Function
%169 = OpAccessChain %_ptr_Uniform_float %23 %int_2
%170 = OpLoad %float %169
%171 = OpConvertFToS %int %170
OpSelectionMerge %172 None
OpSwitch %171 %174 1 %173
%173 = OpLabel
OpStore %x_3 %int_0
OpBranch %176
%176 = OpLabel
OpLoopMerge %180 %179 None
OpBranch %177
%177 = OpLabel
%181 = OpLoad %int %x_3
%182 = OpSLessThanEqual %bool %181 %int_10
OpBranchConditional %182 %178 %180
%178 = OpLabel
OpBranch %179
%179 = OpLabel
%183 = OpLoad %int %x_3
%184 = OpIAdd %int %183 %int_1
OpStore %x_3 %184
OpBranch %176
%180 = OpLabel
OpBranch %174
%174 = OpLabel
OpReturnValue %true
%172 = OpLabel
OpUnreachable
OpFunctionEnd
%switch_with_if_that_returns_b = OpFunction %bool None %36
%185 = OpLabel
%186 = OpAccessChain %_ptr_Uniform_float %23 %int_2
%187 = OpLoad %float %186
%188 = OpConvertFToS %int %187
OpSelectionMerge %189 None
OpSwitch %188 %191 1 %190
%190 = OpLabel
%192 = OpAccessChain %_ptr_Uniform_float %23 %int_2
%193 = OpLoad %float %192
%195 = OpFOrdEqual %bool %193 %float_123
OpSelectionMerge %198 None
OpBranchConditional %195 %196 %197
%196 = OpLabel
OpReturnValue %true
%197 = OpLabel
OpReturnValue %true
%198 = OpLabel
OpBranch %191
%191 = OpLabel
OpReturnValue %true
%189 = OpLabel
OpUnreachable
OpFunctionEnd
%switch_with_one_sided_if_then_fallthrough_b = OpFunction %bool None %36
%199 = OpLabel
%200 = OpAccessChain %_ptr_Uniform_float %23 %int_2
%201 = OpLoad %float %200
%202 = OpConvertFToS %int %201
OpSelectionMerge %203 None
OpSwitch %202 %205 1 %204
%204 = OpLabel
%206 = OpAccessChain %_ptr_Uniform_float %23 %int_2
%207 = OpLoad %float %206
%208 = OpFOrdEqual %bool %207 %float_123
OpSelectionMerge %210 None
OpBranchConditional %208 %209 %210
%209 = OpLabel
OpReturnValue %true
%210 = OpLabel
OpBranch %205
%205 = OpLabel
OpReturnValue %true
%203 = OpLabel
OpUnreachable
OpFunctionEnd
%main = OpFunction %v4float None %211
%212 = OpFunctionParameter %_ptr_Function_v2float
%213 = OpLabel
%266 = OpVariable %_ptr_Function_v4float Function
OpSelectionMerge %215 None
OpBranchConditional %true %214 %215
%214 = OpLabel
%216 = OpFunctionCall %bool %return_on_both_sides_b
OpBranch %215
%215 = OpLabel
%217 = OpPhi %bool %false %213 %216 %214
OpSelectionMerge %219 None
OpBranchConditional %217 %218 %219
%218 = OpLabel
%220 = OpFunctionCall %bool %for_inside_body_b
OpBranch %219
%219 = OpLabel
%221 = OpPhi %bool %false %215 %220 %218
OpSelectionMerge %223 None
OpBranchConditional %221 %222 %223
%222 = OpLabel
%224 = OpFunctionCall %bool %after_for_body_b
OpBranch %223
%223 = OpLabel
%225 = OpPhi %bool %false %219 %224 %222
OpSelectionMerge %227 None
OpBranchConditional %225 %226 %227
%226 = OpLabel
%228 = OpFunctionCall %bool %for_with_double_sided_conditional_return_b
OpBranch %227
%227 = OpLabel
%229 = OpPhi %bool %false %223 %228 %226
OpSelectionMerge %231 None
OpBranchConditional %229 %230 %231
%230 = OpLabel
%232 = OpFunctionCall %bool %if_else_chain_b
OpBranch %231
%231 = OpLabel
%233 = OpPhi %bool %false %227 %232 %230
OpSelectionMerge %235 None
OpBranchConditional %233 %234 %235
%234 = OpLabel
%236 = OpFunctionCall %bool %switch_with_all_returns_b
OpBranch %235
%235 = OpLabel
%237 = OpPhi %bool %false %231 %236 %234
OpSelectionMerge %239 None
OpBranchConditional %237 %238 %239
%238 = OpLabel
%240 = OpFunctionCall %bool %switch_only_default_b
OpBranch %239
%239 = OpLabel
%241 = OpPhi %bool %false %235 %240 %238
OpSelectionMerge %243 None
OpBranchConditional %241 %242 %243
%242 = OpLabel
%244 = OpFunctionCall %bool %switch_fallthrough_b
OpBranch %243
%243 = OpLabel
%245 = OpPhi %bool %false %239 %244 %242
OpSelectionMerge %247 None
OpBranchConditional %245 %246 %247
%246 = OpLabel
%248 = OpFunctionCall %bool %switch_fallthrough_twice_b
OpBranch %247
%247 = OpLabel
%249 = OpPhi %bool %false %243 %248 %246
OpSelectionMerge %251 None
OpBranchConditional %249 %250 %251
%250 = OpLabel
%252 = OpFunctionCall %bool %switch_with_break_in_loop_b
OpBranch %251
%251 = OpLabel
%253 = OpPhi %bool %false %247 %252 %250
OpSelectionMerge %255 None
OpBranchConditional %253 %254 %255
%254 = OpLabel
%256 = OpFunctionCall %bool %switch_with_continue_in_loop_b
OpBranch %255
%255 = OpLabel
%257 = OpPhi %bool %false %251 %256 %254
OpSelectionMerge %259 None
OpBranchConditional %257 %258 %259
%258 = OpLabel
%260 = OpFunctionCall %bool %switch_with_if_that_returns_b
OpBranch %259
%259 = OpLabel
%261 = OpPhi %bool %false %255 %260 %258
OpSelectionMerge %263 None
OpBranchConditional %261 %262 %263
%262 = OpLabel
%264 = OpFunctionCall %bool %switch_with_one_sided_if_then_fallthrough_b
OpBranch %263
%263 = OpLabel
%265 = OpPhi %bool %false %259 %264 %262
OpSelectionMerge %270 None
OpBranchConditional %265 %268 %269
%268 = OpLabel
%271 = OpAccessChain %_ptr_Uniform_v4float %23 %int_0
%273 = OpLoad %v4float %271
OpStore %266 %273
OpBranch %270
%269 = OpLabel
%274 = OpAccessChain %_ptr_Uniform_v4float %23 %int_1
%275 = OpLoad %v4float %274
OpStore %266 %275
OpBranch %270
%270 = OpLabel
%276 = OpLoad %v4float %266
OpReturnValue %276
OpFunctionEnd OpFunctionEnd

View File

@ -25,6 +25,76 @@ bool for_with_double_sided_conditional_return_b() {
bool if_else_chain_b() { bool if_else_chain_b() {
if (unknownInput == 1.0) return true; else if (unknownInput == 2.0) return false; else if (unknownInput == 3.0) return true; else if (unknownInput == 4.0) return false; else return true; if (unknownInput == 1.0) return true; else if (unknownInput == 2.0) return false; else if (unknownInput == 3.0) return true; else if (unknownInput == 4.0) return false; else return true;
} }
vec4 main() { bool switch_with_all_returns_b() {
return ((((true && return_on_both_sides_b()) && for_inside_body_b()) && after_for_body_b()) && for_with_double_sided_conditional_return_b()) && if_else_chain_b() ? colorGreen : colorRed; switch (int(unknownInput)) {
case 1:
return true;
case 2:
return true;
default:
return true;
}
}
bool switch_only_default_b() {
switch (int(unknownInput)) {
case 0:
default:
return true;
}
}
bool switch_fallthrough_b() {
switch (int(unknownInput)) {
case 1:
return true;
case 2:
default:
return true;
}
}
bool switch_fallthrough_twice_b() {
switch (int(unknownInput)) {
case 1:
case 2:
default:
return true;
}
}
bool switch_with_break_in_loop_b() {
switch (int(unknownInput)) {
case 1:
for (int x = 0;x <= 10; ++x) {
break;
}
default:
return true;
}
}
bool switch_with_continue_in_loop_b() {
switch (int(unknownInput)) {
case 1:
for (int x = 0;x <= 10; ++x) {
continue;
}
default:
return true;
}
}
bool switch_with_if_that_returns_b() {
switch (int(unknownInput)) {
case 1:
if (unknownInput == 123.0) return true; else return true;
default:
return true;
}
}
bool switch_with_one_sided_if_then_fallthrough_b() {
switch (int(unknownInput)) {
case 1:
if (unknownInput == 123.0) return true;
default:
return true;
}
}
vec4 main() {
return ((((((((((((true && return_on_both_sides_b()) && for_inside_body_b()) && after_for_body_b()) && for_with_double_sided_conditional_return_b()) && if_else_chain_b()) && switch_with_all_returns_b()) && switch_only_default_b()) && switch_fallthrough_b()) && switch_fallthrough_twice_b()) && switch_with_break_in_loop_b()) && switch_with_continue_in_loop_b()) && switch_with_if_that_returns_b()) && switch_with_one_sided_if_then_fallthrough_b() ? colorGreen : colorRed;
} }

View File

@ -33,9 +33,78 @@ bool for_with_double_sided_conditional_return_b(Uniforms _uniforms) {
bool if_else_chain_b(Uniforms _uniforms) { bool if_else_chain_b(Uniforms _uniforms) {
if (_uniforms.unknownInput == 1.0h) return true; else if (_uniforms.unknownInput == 2.0h) return false; else if (_uniforms.unknownInput == 3.0h) return true; else if (_uniforms.unknownInput == 4.0h) return false; else return true; if (_uniforms.unknownInput == 1.0h) return true; else if (_uniforms.unknownInput == 2.0h) return false; else if (_uniforms.unknownInput == 3.0h) return true; else if (_uniforms.unknownInput == 4.0h) return false; else return true;
} }
bool switch_with_all_returns_b(Uniforms _uniforms) {
switch (int(_uniforms.unknownInput)) {
case 1:
return true;
case 2:
return true;
default:
return true;
}
}
bool switch_only_default_b(Uniforms _uniforms) {
switch (int(_uniforms.unknownInput)) {
default:
return true;
}
}
bool switch_fallthrough_b(Uniforms _uniforms) {
switch (int(_uniforms.unknownInput)) {
case 1:
return true;
case 2:
default:
return true;
}
}
bool switch_fallthrough_twice_b(Uniforms _uniforms) {
switch (int(_uniforms.unknownInput)) {
case 1:
case 2:
default:
return true;
}
}
bool switch_with_break_in_loop_b(Uniforms _uniforms) {
switch (int(_uniforms.unknownInput)) {
case 1:
for (int x = 0;x <= 10; ++x) {
break;
}
default:
return true;
}
}
bool switch_with_continue_in_loop_b(Uniforms _uniforms) {
switch (int(_uniforms.unknownInput)) {
case 1:
for (int x = 0;x <= 10; ++x) {
continue;
}
default:
return true;
}
}
bool switch_with_if_that_returns_b(Uniforms _uniforms) {
switch (int(_uniforms.unknownInput)) {
case 1:
if (_uniforms.unknownInput == 123.0h) return true; else return true;
default:
return true;
}
}
bool switch_with_one_sided_if_then_fallthrough_b(Uniforms _uniforms) {
switch (int(_uniforms.unknownInput)) {
case 1:
if (_uniforms.unknownInput == 123.0h) return true;
default:
return true;
}
}
fragment Outputs fragmentMain(Inputs _in [[stage_in]], constant Uniforms& _uniforms [[buffer(0)]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) { fragment Outputs fragmentMain(Inputs _in [[stage_in]], constant Uniforms& _uniforms [[buffer(0)]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _out; Outputs _out;
(void)_out; (void)_out;
_out.sk_FragColor = ((((true && return_on_both_sides_b(_uniforms)) && for_inside_body_b()) && after_for_body_b()) && for_with_double_sided_conditional_return_b(_uniforms)) && if_else_chain_b(_uniforms) ? _uniforms.colorGreen : _uniforms.colorRed; _out.sk_FragColor = ((((((((((((true && return_on_both_sides_b(_uniforms)) && for_inside_body_b()) && after_for_body_b()) && for_with_double_sided_conditional_return_b(_uniforms)) && if_else_chain_b(_uniforms)) && switch_with_all_returns_b(_uniforms)) && switch_only_default_b(_uniforms)) && switch_fallthrough_b(_uniforms)) && switch_fallthrough_twice_b(_uniforms)) && switch_with_break_in_loop_b(_uniforms)) && switch_with_continue_in_loop_b(_uniforms)) && switch_with_if_that_returns_b(_uniforms)) && switch_with_one_sided_if_then_fallthrough_b(_uniforms) ? _uniforms.colorGreen : _uniforms.colorRed;
return _out; return _out;
} }

View File

@ -15,15 +15,6 @@ OpName %inside_infinite_do_loop_b "inside_infinite_do_loop_b"
OpName %inside_infinite_while_loop_b "inside_infinite_while_loop_b" OpName %inside_infinite_while_loop_b "inside_infinite_while_loop_b"
OpName %after_do_loop_b "after_do_loop_b" OpName %after_do_loop_b "after_do_loop_b"
OpName %after_while_loop_b "after_while_loop_b" OpName %after_while_loop_b "after_while_loop_b"
OpName %switch_with_all_returns_b "switch_with_all_returns_b"
OpName %switch_fallthrough_b "switch_fallthrough_b"
OpName %switch_fallthrough_twice_b "switch_fallthrough_twice_b"
OpName %switch_with_break_in_loop_b "switch_with_break_in_loop_b"
OpName %x "x"
OpName %switch_with_continue_in_loop_b "switch_with_continue_in_loop_b"
OpName %x_0 "x"
OpName %switch_with_if_that_returns_b "switch_with_if_that_returns_b"
OpName %switch_with_one_sided_if_then_fallthrough_b "switch_with_one_sided_if_then_fallthrough_b"
OpName %main "main" OpName %main "main"
OpDecorate %sk_FragColor RelaxedPrecision OpDecorate %sk_FragColor RelaxedPrecision
OpDecorate %sk_FragColor Location 0 OpDecorate %sk_FragColor Location 0
@ -36,21 +27,12 @@ OpMemberDecorate %_UniformBuffer 1 RelaxedPrecision
OpMemberDecorate %_UniformBuffer 2 Offset 32 OpMemberDecorate %_UniformBuffer 2 Offset 32
OpMemberDecorate %_UniformBuffer 2 RelaxedPrecision OpMemberDecorate %_UniformBuffer 2 RelaxedPrecision
OpDecorate %_UniformBuffer Block OpDecorate %_UniformBuffer Block
OpDecorate %22 Binding 0 OpDecorate %15 Binding 0
OpDecorate %22 DescriptorSet 0 OpDecorate %15 DescriptorSet 0
OpDecorate %46 RelaxedPrecision OpDecorate %39 RelaxedPrecision
OpDecorate %77 RelaxedPrecision OpDecorate %96 RelaxedPrecision
OpDecorate %85 RelaxedPrecision OpDecorate %99 RelaxedPrecision
OpDecorate %93 RelaxedPrecision OpDecorate %100 RelaxedPrecision
OpDecorate %101 RelaxedPrecision
OpDecorate %122 RelaxedPrecision
OpDecorate %139 RelaxedPrecision
OpDecorate %145 RelaxedPrecision
OpDecorate %152 RelaxedPrecision
OpDecorate %158 RelaxedPrecision
OpDecorate %217 RelaxedPrecision
OpDecorate %219 RelaxedPrecision
OpDecorate %220 RelaxedPrecision
%float = OpTypeFloat 32 %float = OpTypeFloat 32
%v4float = OpTypeVector %float 4 %v4float = OpTypeVector %float 4
%_ptr_Output_v4float = OpTypePointer Output %v4float %_ptr_Output_v4float = OpTypePointer Output %v4float
@ -60,366 +42,157 @@ OpDecorate %220 RelaxedPrecision
%sk_Clockwise = OpVariable %_ptr_Input_bool Input %sk_Clockwise = OpVariable %_ptr_Input_bool Input
%_UniformBuffer = OpTypeStruct %v4float %v4float %float %_UniformBuffer = OpTypeStruct %v4float %v4float %float
%_ptr_Uniform__UniformBuffer = OpTypePointer Uniform %_UniformBuffer %_ptr_Uniform__UniformBuffer = OpTypePointer Uniform %_UniformBuffer
%22 = OpVariable %_ptr_Uniform__UniformBuffer Uniform %15 = OpVariable %_ptr_Uniform__UniformBuffer Uniform
%void = OpTypeVoid %void = OpTypeVoid
%27 = OpTypeFunction %void %20 = OpTypeFunction %void
%v2float = OpTypeVector %float 2 %v2float = OpTypeVector %float 2
%float_0 = OpConstant %float 0 %float_0 = OpConstant %float 0
%31 = OpConstantComposite %v2float %float_0 %float_0 %24 = OpConstantComposite %v2float %float_0 %float_0
%_ptr_Function_v2float = OpTypePointer Function %v2float %_ptr_Function_v2float = OpTypePointer Function %v2float
%35 = OpTypeFunction %bool %28 = OpTypeFunction %bool
%_ptr_Uniform_float = OpTypePointer Uniform %float %_ptr_Uniform_float = OpTypePointer Uniform %float
%int = OpTypeInt 32 1 %int = OpTypeInt 32 1
%int_2 = OpConstant %int 2 %int_2 = OpConstant %int 2
%float_123 = OpConstant %float 123 %float_123 = OpConstant %float 123
%false = OpConstantFalse %bool %false = OpConstantFalse %bool
%true = OpConstantTrue %bool %true = OpConstantTrue %bool
%_ptr_Function_int = OpTypePointer Function %int %68 = OpTypeFunction %v4float %_ptr_Function_v2float
%int_0 = OpConstant %int 0
%int_10 = OpConstant %int 10
%int_1 = OpConstant %int 1
%162 = OpTypeFunction %v4float %_ptr_Function_v2float
%_ptr_Function_v4float = OpTypePointer Function %v4float %_ptr_Function_v4float = OpTypePointer Function %v4float
%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float %_ptr_Uniform_v4float = OpTypePointer Uniform %v4float
%_entrypoint_v = OpFunction %void None %27 %int_0 = OpConstant %int 0
%28 = OpLabel %int_1 = OpConstant %int 1
%32 = OpVariable %_ptr_Function_v2float Function %_entrypoint_v = OpFunction %void None %20
OpStore %32 %31 %21 = OpLabel
%34 = OpFunctionCall %v4float %main %32 %25 = OpVariable %_ptr_Function_v2float Function
OpStore %sk_FragColor %34 OpStore %25 %24
%27 = OpFunctionCall %v4float %main %25
OpStore %sk_FragColor %27
OpReturn OpReturn
OpFunctionEnd OpFunctionEnd
%inside_while_loop_b = OpFunction %bool None %35 %inside_while_loop_b = OpFunction %bool None %28
%36 = OpLabel %29 = OpLabel
OpBranch %37 OpBranch %30
%37 = OpLabel %30 = OpLabel
OpLoopMerge %41 %40 None OpLoopMerge %34 %33 None
OpBranch %38 OpBranch %31
%38 = OpLabel %31 = OpLabel
%42 = OpAccessChain %_ptr_Uniform_float %22 %int_2 %35 = OpAccessChain %_ptr_Uniform_float %15 %int_2
%46 = OpLoad %float %42 %39 = OpLoad %float %35
%48 = OpFOrdEqual %bool %46 %float_123 %41 = OpFOrdEqual %bool %39 %float_123
OpBranchConditional %48 %39 %41 OpBranchConditional %41 %32 %34
%39 = OpLabel %32 = OpLabel
OpReturnValue %false OpReturnValue %false
%40 = OpLabel %33 = OpLabel
OpBranch %37 OpBranch %30
%41 = OpLabel %34 = OpLabel
OpReturnValue %true OpReturnValue %true
OpFunctionEnd OpFunctionEnd
%inside_infinite_do_loop_b = OpFunction %bool None %35 %inside_infinite_do_loop_b = OpFunction %bool None %28
%44 = OpLabel
OpBranch %45
%45 = OpLabel
OpLoopMerge %49 %48 None
OpBranch %46
%46 = OpLabel
OpReturnValue %true
%47 = OpLabel
OpBranch %48
%48 = OpLabel
OpBranchConditional %true %45 %49
%49 = OpLabel
OpUnreachable
OpFunctionEnd
%inside_infinite_while_loop_b = OpFunction %bool None %28
%50 = OpLabel
OpBranch %51
%51 = OpLabel %51 = OpLabel
OpLoopMerge %55 %54 None
OpBranch %52 OpBranch %52
%52 = OpLabel %52 = OpLabel
OpLoopMerge %56 %55 None OpBranchConditional %true %53 %55
OpBranch %53
%53 = OpLabel %53 = OpLabel
OpReturnValue %true OpReturnValue %true
%54 = OpLabel %54 = OpLabel
OpBranch %55 OpBranch %51
%55 = OpLabel %55 = OpLabel
OpBranchConditional %true %52 %56
%56 = OpLabel
OpUnreachable OpUnreachable
OpFunctionEnd OpFunctionEnd
%inside_infinite_while_loop_b = OpFunction %bool None %35 %after_do_loop_b = OpFunction %bool None %28
%56 = OpLabel
OpBranch %57
%57 = OpLabel %57 = OpLabel
OpLoopMerge %61 %60 None
OpBranch %58 OpBranch %58
%58 = OpLabel %58 = OpLabel
OpLoopMerge %62 %61 None OpBranch %61
OpBranch %59
%59 = OpLabel %59 = OpLabel
OpBranchConditional %true %60 %62 OpBranch %60
%60 = OpLabel %60 = OpLabel
OpReturnValue %true OpBranchConditional %true %57 %61
%61 = OpLabel %61 = OpLabel
OpBranch %58 OpReturnValue %true
%62 = OpLabel
OpUnreachable
OpFunctionEnd OpFunctionEnd
%after_do_loop_b = OpFunction %bool None %35 %after_while_loop_b = OpFunction %bool None %28
%62 = OpLabel
OpBranch %63
%63 = OpLabel %63 = OpLabel
OpLoopMerge %67 %66 None
OpBranch %64 OpBranch %64
%64 = OpLabel %64 = OpLabel
OpLoopMerge %68 %67 None OpBranchConditional %true %65 %67
OpBranch %65
%65 = OpLabel %65 = OpLabel
OpBranch %68
%66 = OpLabel
OpBranch %67 OpBranch %67
%66 = OpLabel
OpBranch %63
%67 = OpLabel %67 = OpLabel
OpBranchConditional %true %64 %68
%68 = OpLabel
OpReturnValue %true OpReturnValue %true
OpFunctionEnd OpFunctionEnd
%after_while_loop_b = OpFunction %bool None %35 %main = OpFunction %v4float None %68
%69 = OpLabel %69 = OpFunctionParameter %_ptr_Function_v2float
OpBranch %70
%70 = OpLabel %70 = OpLabel
OpLoopMerge %74 %73 None %88 = OpVariable %_ptr_Function_v4float Function
OpBranch %71 %71 = OpFunctionCall %bool %inside_while_loop_b
%71 = OpLabel OpSelectionMerge %73 None
OpBranchConditional %true %72 %74 OpBranchConditional %71 %72 %73
%72 = OpLabel %72 = OpLabel
OpBranch %74 %74 = OpFunctionCall %bool %inside_infinite_do_loop_b
OpBranch %73
%73 = OpLabel %73 = OpLabel
OpBranch %70 %75 = OpPhi %bool %false %70 %74 %72
%74 = OpLabel OpSelectionMerge %77 None
OpReturnValue %true OpBranchConditional %75 %76 %77
OpFunctionEnd %76 = OpLabel
%switch_with_all_returns_b = OpFunction %bool None %35 %78 = OpFunctionCall %bool %inside_infinite_while_loop_b
%75 = OpLabel OpBranch %77
%76 = OpAccessChain %_ptr_Uniform_float %22 %int_2 %77 = OpLabel
%77 = OpLoad %float %76 %79 = OpPhi %bool %false %73 %78 %76
%78 = OpConvertFToS %int %77 OpSelectionMerge %81 None
OpSelectionMerge %79 None OpBranchConditional %79 %80 %81
OpSwitch %78 %82 1 %80 2 %81
%80 = OpLabel %80 = OpLabel
OpReturnValue %true %82 = OpFunctionCall %bool %after_do_loop_b
OpBranch %81
%81 = OpLabel %81 = OpLabel
OpReturnValue %false %83 = OpPhi %bool %false %77 %82 %80
%82 = OpLabel OpSelectionMerge %85 None
OpReturnValue %false OpBranchConditional %83 %84 %85
%79 = OpLabel %84 = OpLabel
OpUnreachable %86 = OpFunctionCall %bool %after_while_loop_b
OpFunctionEnd OpBranch %85
%switch_fallthrough_b = OpFunction %bool None %35 %85 = OpLabel
%83 = OpLabel %87 = OpPhi %bool %false %81 %86 %84
%84 = OpAccessChain %_ptr_Uniform_float %22 %int_2 OpSelectionMerge %92 None
%85 = OpLoad %float %84 OpBranchConditional %87 %90 %91
%86 = OpConvertFToS %int %85
OpSelectionMerge %87 None
OpSwitch %86 %90 1 %88 2 %89
%88 = OpLabel
OpReturnValue %true
%89 = OpLabel
OpBranch %90
%90 = OpLabel %90 = OpLabel
OpReturnValue %false %93 = OpAccessChain %_ptr_Uniform_v4float %15 %int_0
%87 = OpLabel %96 = OpLoad %v4float %93
OpUnreachable OpStore %88 %96
OpFunctionEnd OpBranch %92
%switch_fallthrough_twice_b = OpFunction %bool None %35
%91 = OpLabel %91 = OpLabel
%92 = OpAccessChain %_ptr_Uniform_float %22 %int_2 %97 = OpAccessChain %_ptr_Uniform_v4float %15 %int_1
%93 = OpLoad %float %92 %99 = OpLoad %v4float %97
%94 = OpConvertFToS %int %93 OpStore %88 %99
OpSelectionMerge %95 None OpBranch %92
OpSwitch %94 %98 1 %96 2 %97 %92 = OpLabel
%96 = OpLabel %100 = OpLoad %v4float %88
OpBranch %97 OpReturnValue %100
%97 = OpLabel
OpBranch %98
%98 = OpLabel
OpReturnValue %true
%95 = OpLabel
OpUnreachable
OpFunctionEnd
%switch_with_break_in_loop_b = OpFunction %bool None %35
%99 = OpLabel
%x = OpVariable %_ptr_Function_int Function
%100 = OpAccessChain %_ptr_Uniform_float %22 %int_2
%101 = OpLoad %float %100
%102 = OpConvertFToS %int %101
OpSelectionMerge %103 None
OpSwitch %102 %105 1 %104
%104 = OpLabel
OpStore %x %int_0
OpBranch %109
%109 = OpLabel
OpLoopMerge %113 %112 None
OpBranch %110
%110 = OpLabel
%114 = OpLoad %int %x
%116 = OpSLessThanEqual %bool %114 %int_10
OpBranchConditional %116 %111 %113
%111 = OpLabel
OpBranch %113
%112 = OpLabel
%118 = OpLoad %int %x
%119 = OpIAdd %int %118 %int_1
OpStore %x %119
OpBranch %109
%113 = OpLabel
OpBranch %105
%105 = OpLabel
OpReturnValue %true
%103 = OpLabel
OpUnreachable
OpFunctionEnd
%switch_with_continue_in_loop_b = OpFunction %bool None %35
%120 = OpLabel
%x_0 = OpVariable %_ptr_Function_int Function
%121 = OpAccessChain %_ptr_Uniform_float %22 %int_2
%122 = OpLoad %float %121
%123 = OpConvertFToS %int %122
OpSelectionMerge %124 None
OpSwitch %123 %126 1 %125
%125 = OpLabel
OpStore %x_0 %int_0
OpBranch %128
%128 = OpLabel
OpLoopMerge %132 %131 None
OpBranch %129
%129 = OpLabel
%133 = OpLoad %int %x_0
%134 = OpSLessThanEqual %bool %133 %int_10
OpBranchConditional %134 %130 %132
%130 = OpLabel
OpBranch %131
%131 = OpLabel
%135 = OpLoad %int %x_0
%136 = OpIAdd %int %135 %int_1
OpStore %x_0 %136
OpBranch %128
%132 = OpLabel
OpBranch %126
%126 = OpLabel
OpReturnValue %true
%124 = OpLabel
OpUnreachable
OpFunctionEnd
%switch_with_if_that_returns_b = OpFunction %bool None %35
%137 = OpLabel
%138 = OpAccessChain %_ptr_Uniform_float %22 %int_2
%139 = OpLoad %float %138
%140 = OpConvertFToS %int %139
OpSelectionMerge %141 None
OpSwitch %140 %143 1 %142
%142 = OpLabel
%144 = OpAccessChain %_ptr_Uniform_float %22 %int_2
%145 = OpLoad %float %144
%146 = OpFOrdEqual %bool %145 %float_123
OpSelectionMerge %149 None
OpBranchConditional %146 %147 %148
%147 = OpLabel
OpReturnValue %false
%148 = OpLabel
OpReturnValue %true
%149 = OpLabel
OpBranch %143
%143 = OpLabel
OpReturnValue %true
%141 = OpLabel
OpUnreachable
OpFunctionEnd
%switch_with_one_sided_if_then_fallthrough_b = OpFunction %bool None %35
%150 = OpLabel
%151 = OpAccessChain %_ptr_Uniform_float %22 %int_2
%152 = OpLoad %float %151
%153 = OpConvertFToS %int %152
OpSelectionMerge %154 None
OpSwitch %153 %156 1 %155
%155 = OpLabel
%157 = OpAccessChain %_ptr_Uniform_float %22 %int_2
%158 = OpLoad %float %157
%159 = OpFOrdEqual %bool %158 %float_123
OpSelectionMerge %161 None
OpBranchConditional %159 %160 %161
%160 = OpLabel
OpReturnValue %false
%161 = OpLabel
OpBranch %156
%156 = OpLabel
OpReturnValue %true
%154 = OpLabel
OpUnreachable
OpFunctionEnd
%main = OpFunction %v4float None %162
%163 = OpFunctionParameter %_ptr_Function_v2float
%164 = OpLabel
%210 = OpVariable %_ptr_Function_v4float Function
%165 = OpFunctionCall %bool %inside_while_loop_b
OpSelectionMerge %167 None
OpBranchConditional %165 %166 %167
%166 = OpLabel
%168 = OpFunctionCall %bool %inside_infinite_do_loop_b
OpBranch %167
%167 = OpLabel
%169 = OpPhi %bool %false %164 %168 %166
OpSelectionMerge %171 None
OpBranchConditional %169 %170 %171
%170 = OpLabel
%172 = OpFunctionCall %bool %inside_infinite_while_loop_b
OpBranch %171
%171 = OpLabel
%173 = OpPhi %bool %false %167 %172 %170
OpSelectionMerge %175 None
OpBranchConditional %173 %174 %175
%174 = OpLabel
%176 = OpFunctionCall %bool %after_do_loop_b
OpBranch %175
%175 = OpLabel
%177 = OpPhi %bool %false %171 %176 %174
OpSelectionMerge %179 None
OpBranchConditional %177 %178 %179
%178 = OpLabel
%180 = OpFunctionCall %bool %after_while_loop_b
OpBranch %179
%179 = OpLabel
%181 = OpPhi %bool %false %175 %180 %178
OpSelectionMerge %183 None
OpBranchConditional %181 %182 %183
%182 = OpLabel
%184 = OpFunctionCall %bool %switch_with_all_returns_b
OpBranch %183
%183 = OpLabel
%185 = OpPhi %bool %false %179 %184 %182
OpSelectionMerge %187 None
OpBranchConditional %185 %186 %187
%186 = OpLabel
%188 = OpFunctionCall %bool %switch_fallthrough_b
OpBranch %187
%187 = OpLabel
%189 = OpPhi %bool %false %183 %188 %186
OpSelectionMerge %191 None
OpBranchConditional %189 %190 %191
%190 = OpLabel
%192 = OpFunctionCall %bool %switch_fallthrough_twice_b
OpBranch %191
%191 = OpLabel
%193 = OpPhi %bool %false %187 %192 %190
OpSelectionMerge %195 None
OpBranchConditional %193 %194 %195
%194 = OpLabel
%196 = OpFunctionCall %bool %switch_with_break_in_loop_b
OpBranch %195
%195 = OpLabel
%197 = OpPhi %bool %false %191 %196 %194
OpSelectionMerge %199 None
OpBranchConditional %197 %198 %199
%198 = OpLabel
%200 = OpFunctionCall %bool %switch_with_continue_in_loop_b
OpBranch %199
%199 = OpLabel
%201 = OpPhi %bool %false %195 %200 %198
OpSelectionMerge %203 None
OpBranchConditional %201 %202 %203
%202 = OpLabel
%204 = OpFunctionCall %bool %switch_with_if_that_returns_b
OpBranch %203
%203 = OpLabel
%205 = OpPhi %bool %false %199 %204 %202
OpSelectionMerge %207 None
OpBranchConditional %205 %206 %207
%206 = OpLabel
%208 = OpFunctionCall %bool %switch_with_one_sided_if_then_fallthrough_b
OpBranch %207
%207 = OpLabel
%209 = OpPhi %bool %false %203 %208 %206
OpSelectionMerge %214 None
OpBranchConditional %209 %212 %213
%212 = OpLabel
%215 = OpAccessChain %_ptr_Uniform_v4float %22 %int_0
%217 = OpLoad %v4float %215
OpStore %210 %217
OpBranch %214
%213 = OpLabel
%218 = OpAccessChain %_ptr_Uniform_v4float %22 %int_1
%219 = OpLoad %v4float %218
OpStore %210 %219
OpBranch %214
%214 = OpLabel
%220 = OpLoad %v4float %210
OpReturnValue %220
OpFunctionEnd OpFunctionEnd

View File

@ -31,69 +31,6 @@ bool after_while_loop_b() {
} }
return true; return true;
} }
bool switch_with_all_returns_b() {
switch (int(unknownInput)) {
case 1:
return true;
case 2:
return false;
default:
return false;
}
}
bool switch_fallthrough_b() {
switch (int(unknownInput)) {
case 1:
return true;
case 2:
default:
return false;
}
}
bool switch_fallthrough_twice_b() {
switch (int(unknownInput)) {
case 1:
case 2:
default:
return true;
}
}
bool switch_with_break_in_loop_b() {
switch (int(unknownInput)) {
case 1:
for (int x = 0;x <= 10; ++x) {
break;
}
default:
return true;
}
}
bool switch_with_continue_in_loop_b() {
switch (int(unknownInput)) {
case 1:
for (int x = 0;x <= 10; ++x) {
continue;
}
default:
return true;
}
}
bool switch_with_if_that_returns_b() {
switch (int(unknownInput)) {
case 1:
if (unknownInput == 123.0) return false; else return true;
default:
return true;
}
}
bool switch_with_one_sided_if_then_fallthrough_b() {
switch (int(unknownInput)) {
case 1:
if (unknownInput == 123.0) return false;
default:
return true;
}
}
vec4 main() { vec4 main() {
return ((((((((((inside_while_loop_b() && inside_infinite_do_loop_b()) && inside_infinite_while_loop_b()) && after_do_loop_b()) && after_while_loop_b()) && switch_with_all_returns_b()) && switch_fallthrough_b()) && switch_fallthrough_twice_b()) && switch_with_break_in_loop_b()) && switch_with_continue_in_loop_b()) && switch_with_if_that_returns_b()) && switch_with_one_sided_if_then_fallthrough_b() ? colorGreen : colorRed; return (((inside_while_loop_b() && inside_infinite_do_loop_b()) && inside_infinite_while_loop_b()) && after_do_loop_b()) && after_while_loop_b() ? colorGreen : colorRed;
} }

View File

@ -39,72 +39,9 @@ bool after_while_loop_b() {
} }
return true; return true;
} }
bool switch_with_all_returns_b(Uniforms _uniforms) {
switch (int(_uniforms.unknownInput)) {
case 1:
return true;
case 2:
return false;
default:
return false;
}
}
bool switch_fallthrough_b(Uniforms _uniforms) {
switch (int(_uniforms.unknownInput)) {
case 1:
return true;
case 2:
default:
return false;
}
}
bool switch_fallthrough_twice_b(Uniforms _uniforms) {
switch (int(_uniforms.unknownInput)) {
case 1:
case 2:
default:
return true;
}
}
bool switch_with_break_in_loop_b(Uniforms _uniforms) {
switch (int(_uniforms.unknownInput)) {
case 1:
for (int x = 0;x <= 10; ++x) {
break;
}
default:
return true;
}
}
bool switch_with_continue_in_loop_b(Uniforms _uniforms) {
switch (int(_uniforms.unknownInput)) {
case 1:
for (int x = 0;x <= 10; ++x) {
continue;
}
default:
return true;
}
}
bool switch_with_if_that_returns_b(Uniforms _uniforms) {
switch (int(_uniforms.unknownInput)) {
case 1:
if (_uniforms.unknownInput == 123.0h) return false; else return true;
default:
return true;
}
}
bool switch_with_one_sided_if_then_fallthrough_b(Uniforms _uniforms) {
switch (int(_uniforms.unknownInput)) {
case 1:
if (_uniforms.unknownInput == 123.0h) return false;
default:
return true;
}
}
fragment Outputs fragmentMain(Inputs _in [[stage_in]], constant Uniforms& _uniforms [[buffer(0)]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) { fragment Outputs fragmentMain(Inputs _in [[stage_in]], constant Uniforms& _uniforms [[buffer(0)]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _out; Outputs _out;
(void)_out; (void)_out;
_out.sk_FragColor = ((((((((((inside_while_loop_b(_uniforms) && inside_infinite_do_loop_b()) && inside_infinite_while_loop_b()) && after_do_loop_b()) && after_while_loop_b()) && switch_with_all_returns_b(_uniforms)) && switch_fallthrough_b(_uniforms)) && switch_fallthrough_twice_b(_uniforms)) && switch_with_break_in_loop_b(_uniforms)) && switch_with_continue_in_loop_b(_uniforms)) && switch_with_if_that_returns_b(_uniforms)) && switch_with_one_sided_if_then_fallthrough_b(_uniforms) ? _uniforms.colorGreen : _uniforms.colorRed; _out.sk_FragColor = (((inside_while_loop_b(_uniforms) && inside_infinite_do_loop_b()) && inside_infinite_while_loop_b()) && after_do_loop_b()) && after_while_loop_b() ? _uniforms.colorGreen : _uniforms.colorRed;
return _out; return _out;
} }