]> git.rm.cloudns.org Git - xonotic/gmqcc.git/commitdiff
invalid-assign testcase for non-lvalue stores
authorWolfgang (Blub) Bumiller <blub@speed.at>
Tue, 30 Oct 2012 20:21:23 +0000 (21:21 +0100)
committerWolfgang (Blub) Bumiller <blub@speed.at>
Tue, 30 Oct 2012 20:21:23 +0000 (21:21 +0100)
testsuite/Makefile
testsuite/invalid-assign/main.qc [new file with mode: 0644]

index 669ba57c14b14ed75b123e6a89ca9828f705be18..d238455ceba57af9bcfa197b79f1d3c525f3fffe 100644 (file)
@@ -14,7 +14,8 @@ TESTLIST = \
        equality   \
        fields1    \
        invalid-types \
-       ngraphs
+       ngraphs    \
+       invalid-assign
 
 .PHONY: clean test
 
@@ -134,6 +135,7 @@ fields1:
        @diff $@/output $@/expected
 
 invalid-types-ok: obj invalid-types/assign.qc invalid-types/op.qc invalid-types/call1.qc invalid-types/call2.qc invalid-types/call3.qc
+       @echo "Testing: invalid-types"
        @if $(QCC) -std=qcc -o obj/invalid.dat invalid-types/op.qc     > obj/invalid.out 2>&1 ; then echo "Successfully compiled a file which was supposed to fail: op.qc"     ; false ; else true ; fi
        @if $(QCC) -std=qcc -o obj/invalid.dat invalid-types/call1.qc  > obj/invalid.out 2>&1 ; then echo "Successfully compiled a file which was supposed to fail: call1.qc"  ; false ; else true ; fi
        @if $(QCC) -std=qcc -o obj/invalid.dat invalid-types/call2.qc  > obj/invalid.out 2>&1 ; then echo "Successfully compiled a file which was supposed to fail: call2.qc"  ; false ; else true ; fi
@@ -148,6 +150,12 @@ ngraphs:
        @$(VM) $< > $@/output
        @diff $@/output $@/expected
 
+invalid-assign-ok: obj invalid-assign/main.qc
+       @echo "Testing: invalid-assign"
+       @if $(QCC) -std=qcc -o obj/invalid.dat invalid-assign/main.qc > obj/invalid.out 2>&1 ; then echo "Successfully compiled a file which was supposed to fail: invalid-assign/main.qc" ; false ; else true ; fi
+
+invalid-assign: invalid-assign-ok
+
 #######################################################################
 obj:
        mkdir obj
diff --git a/testsuite/invalid-assign/main.qc b/testsuite/invalid-assign/main.qc
new file mode 100644 (file)
index 0000000..264ea5a
--- /dev/null
@@ -0,0 +1,4 @@
+void() main = {
+       local float x;
+       x + 3 = 5;
+};