[glsl][ir] Add `glsl-ir` to the e2e runner.

This CL updates the tint end-to-end runner to allow running with
`glsl-ir` as the backend.

Bug: 42251044
Change-Id: I0b3c8c084915d05c697e6d7cd3eb7b5d0342ad74
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/204095
Reviewed-by: James Price <jrprice@google.com>
Commit-Queue: dan sinclair <dsinclair@chromium.org>
diff --git a/tools/src/cmd/tests/main.go b/tools/src/cmd/tests/main.go
index be628ba..75e40ff 100644
--- a/tools/src/cmd/tests/main.go
+++ b/tools/src/cmd/tests/main.go
@@ -62,6 +62,7 @@
 	testTimeout = 2 * time.Minute
 
 	glsl      = outputFormat("glsl")
+	glslIR    = outputFormat("glsl-ir")
 	hlslFXC   = outputFormat("hlsl-fxc")
 	hlslFXCIR = outputFormat("hlsl-fxc-ir")
 	hlslDXC   = outputFormat("hlsl-dxc")
@@ -73,7 +74,7 @@
 )
 
 // allOutputFormats holds all the supported outputFormats
-var allOutputFormats = []outputFormat{wgsl, spvasm, msl, mslIR, hlslDXC, hlslDXCIR, hlslFXC, hlslFXCIR, glsl}
+var allOutputFormats = []outputFormat{wgsl, spvasm, msl, mslIR, hlslDXC, hlslDXCIR, hlslFXC, hlslFXCIR, glsl, glslIR}
 
 // The root directory of the dawn project
 var dawnRoot = fileutils.DawnRoot()
@@ -139,7 +140,7 @@
 	var maxTableWidth int
 	numCPU := runtime.NumCPU()
 	verbose, generateExpected, generateSkip := false, false, false
-	flag.StringVar(&formatList, "format", "all", "comma separated list of formats to emit. Possible values are: all, wgsl, spvasm, msl, hlsl, hlsl-dxc, hlsl-fxc, glsl, msl-ir, hlsl-ir, hlsl-dxc-ir, hlsl-fxc-ir")
+	flag.StringVar(&formatList, "format", "all", "comma separated list of formats to emit. Possible values are: all, wgsl, spvasm, msl, msl-ir, hlsl, hlsl-ir, hlsl-dxc, hlsl-dxc-ir, hlsl-fxc, hlsl-fxc-ir, glsl, glsl-ir")
 	flag.StringVar(&ignore, "ignore", "**.expected.*", "files to ignore in globs")
 	flag.StringVar(&dxcPath, "dxcompiler", "", "path to DXC DLL for validating HLSL output")
 	flag.StringVar(&fxcPath, "fxc", "", "path to FXC DLL for validating HLSL output")
@@ -673,7 +674,7 @@
 		// expectedFilePath is the path to the expected output file for the given test
 		expectedFilePath := j.file + ".expected."
 
-		useIr := j.format == hlslDXCIR || j.format == hlslFXCIR || j.format == mslIR
+		useIr := j.format == hlslDXCIR || j.format == hlslFXCIR || j.format == mslIR || j.format == glslIR
 
 		switch j.format {
 		case hlslDXC:
@@ -686,6 +687,8 @@
 			expectedFilePath += "ir.fxc.hlsl"
 		case mslIR:
 			expectedFilePath += "ir.msl"
+		case glslIR:
+			expectedFilePath += "ir.glsl"
 		default:
 			expectedFilePath += string(j.format)
 		}
@@ -731,7 +734,7 @@
 		case wgsl:
 			args = append(args, "--validate") // wgsl validation uses Tint, so is always available
 			validate = true
-		case spvasm, glsl:
+		case spvasm, glsl, glslIR:
 			args = append(args, "--validate") // spirv-val and glslang are statically linked, always available
 			validate = true
 		case hlslDXC:
@@ -1049,6 +1052,8 @@
 		return []outputFormat{hlslFXCIR}, nil
 	case "glsl":
 		return []outputFormat{glsl}, nil
+	case "glsl-ir":
+		return []outputFormat{glslIR}, nil
 	default:
 		return nil, fmt.Errorf("unknown format '%s'", s)
 	}