aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/lvalue-conversion.c6
-rw-r--r--tests/lvalue-conversion.qbe14
2 files changed, 20 insertions, 0 deletions
diff --git a/tests/lvalue-conversion.c b/tests/lvalue-conversion.c
new file mode 100644
index 0000000..6bbc326
--- /dev/null
+++ b/tests/lvalue-conversion.c
@@ -0,0 +1,6 @@
+void g();
+void f(void) {
+ static const unsigned char c = 0;
+ g(c);
+ g(~c);
+}
diff --git a/tests/lvalue-conversion.qbe b/tests/lvalue-conversion.qbe
new file mode 100644
index 0000000..ac5fbc3
--- /dev/null
+++ b/tests/lvalue-conversion.qbe
@@ -0,0 +1,14 @@
+data $.Lc.2 = align 1 { b 0, }
+export
+function $f() {
+@start.1
+@body.2
+ %.1 =w loadub $.Lc.2
+ %.2 =w extub %.1
+ call $g(w %.2)
+ %.3 =w loadub $.Lc.2
+ %.4 =w extub %.3
+ %.5 =w xor %.4, 18446744073709551615
+ call $g(w %.5)
+ ret
+}