shithub: scc

Download patch

ref: 56278d4ed0aeb9e8896082e9aefdded9e9228a02
parent: 8105290a1e8cc4bda9b9bb7e9583b9282fcb1cb1
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Sat Nov 13 03:21:25 EST 2021

tests/cc: Improve test 0152-cat.c

Returning different values in every case helps while debugging.

--- a/tests/cc/execute/0152-cat.c
+++ b/tests/cc/execute/0152-cat.c
@@ -3,12 +3,19 @@
 #define FOO foo
 #define BAR bar
 
+int foobar;
+
 int
 main(void)
 {
-	int foo, bar, foobar;
+	int foo = 1, bar = 0;
 
-	CAT(foo,bar) = foo + bar;
-	XCAT(FOO,BAR) = foo + bar;
+	CAT(foo,bar) += foo + bar;
+	if (foobar != 1)
+		return 1;
+	XCAT(FOO,BAR) += foo + bar;
+	if (foobar != 2)
+		return 2;
+
 	return 0;
 }