aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/common-real-unsigned-char.c3
-rw-r--r--test/common-real-unsigned-char.qbe12
-rw-r--r--test/compare-char.qbe8
3 files changed, 19 insertions, 4 deletions
diff --git a/test/common-real-unsigned-char.c b/test/common-real-unsigned-char.c
new file mode 100644
index 0000000..c4a7625
--- /dev/null
+++ b/test/common-real-unsigned-char.c
@@ -0,0 +1,3 @@
+int main(void) {
+ return ((unsigned char)1 - (unsigned char)2) > 0;
+}
diff --git a/test/common-real-unsigned-char.qbe b/test/common-real-unsigned-char.qbe
new file mode 100644
index 0000000..4835e5a
--- /dev/null
+++ b/test/common-real-unsigned-char.qbe
@@ -0,0 +1,12 @@
+export
+function w $main() {
+@start.1
+@body.2
+ %.1 =w copy 1
+ %.2 =w extub %.1
+ %.3 =w copy 2
+ %.4 =w extub %.3
+ %.5 =w sub %.2, %.4
+ %.6 =w csgtw %.5, 0
+ ret %.6
+}
diff --git a/test/compare-char.qbe b/test/compare-char.qbe
index a0a1c03..33ccd4c 100644
--- a/test/compare-char.qbe
+++ b/test/compare-char.qbe
@@ -3,9 +3,9 @@ function w $main() {
@start.1
@body.2
%.1 =w copy 0
- %.2 =w copy 256
- %.3 =w extub %.1
- %.4 =w extub %.2
- %.5 =w cultw %.3, %.4
+ %.2 =w extub %.1
+ %.3 =w copy 256
+ %.4 =w extub %.3
+ %.5 =w csltw %.2, %.4
ret %.5
}