Regres: Fix debug macro detection

`err` was getting nullified when the program terminated abnormally, preventing the regex matching logic from being called.

Should fix binning of abortion caused by SwiftShader debug macros.

Change-Id: I811441296841c77cb87839039cde754d13f2a108
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/39309
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Reviewed-by: Paul Thomson <paulthomson@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Ben Clayton <bclayton@google.com>
diff --git a/tests/regres/deqp/deqp.go b/tests/regres/deqp/deqp.go
index cc5066d..a467695 100644
--- a/tests/regres/deqp/deqp.go
+++ b/tests/regres/deqp/deqp.go
@@ -282,6 +282,27 @@
 			out = strings.ReplaceAll(out, k, v)
 		}
 
+		for _, test := range []struct {
+			re *regexp.Regexp
+			s  testlist.Status
+		}{
+			{unimplementedRE, testlist.Unimplemented},
+			{unsupportedRE, testlist.Unsupported},
+			{unreachableRE, testlist.Unreachable},
+			{assertRE, testlist.Assert},
+			{abortRE, testlist.Abort},
+		} {
+			if s := test.re.FindString(out); s != "" {
+				results <- TestResult{
+					Test:      name,
+					Status:    test.s,
+					TimeTaken: duration,
+					Err:       s,
+				}
+				continue nextTest
+			}
+		}
+
 		// Don't treat non-zero error codes as crashes.
 		var exitErr *exec.ExitError
 		if errors.As(err, &exitErr) {
@@ -293,26 +314,6 @@
 
 		switch err.(type) {
 		default:
-			for _, test := range []struct {
-				re *regexp.Regexp
-				s  testlist.Status
-			}{
-				{unimplementedRE, testlist.Unimplemented},
-				{unsupportedRE, testlist.Unsupported},
-				{unreachableRE, testlist.Unreachable},
-				{assertRE, testlist.Assert},
-				{abortRE, testlist.Abort},
-			} {
-				if s := test.re.FindString(out); s != "" {
-					results <- TestResult{
-						Test:      name,
-						Status:    test.s,
-						TimeTaken: duration,
-						Err:       s,
-					}
-					continue nextTest
-				}
-			}
 			results <- TestResult{
 				Test:      name,
 				Status:    testlist.Crash,