summary refs log tree commit diff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/cmp1.ssa17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/cmp1.ssa b/test/cmp1.ssa
new file mode 100644
index 0000000..dd5bfa1
--- /dev/null
+++ b/test/cmp1.ssa
@@ -0,0 +1,17 @@
+# test cmp used in jnz as well as its result value
+
+export
+function w $test(w %c) {
+@start
+	%cmp =w cultw 1, %c
+	jnz %cmp, @yes, @no
+@yes
+	%cmp =w copy 1
+@no
+	ret %cmp
+}
+
+# >>> driver
+# int test(int);
+# int main(void) { return test(0); }
+# <<<