shithub: scc

Download patch

ref: 82eb1ebc8c335785da14e6e59e7c109256b5ed3c
parent: 045dd2bcc4b996cc2543646b612e28e7fa31b47a
author: Roberto E. Vargas Caballero <[email protected]>
date: Tue Aug 28 17:02:27 EDT 2018

[tests/scc] Avoid division by zero

0141-int-ident.c was created as a way to check the integer
identities but it wasn't a good option to check the runtime
behaviour because it had division by zero. This version
solves the problem ensuring that the division is not actually executed.

--- a/tests/scc/execute/0141-int-iden.c
+++ b/tests/scc/execute/0141-int-iden.c
@@ -32,6 +32,11 @@
 	i = i & ~0;
 	i = ~0 & i;
 	i = i % 1;
-	i = i / 0;
-	i = i % 0;
+
+	if (0)
+		i = i / 0;
+	if (0)
+		i = i % 0;
+
+	return 0;
 }