From: Wolfgang (Blub) Bumiller Date: Tue, 30 Oct 2012 20:21:23 +0000 (+0100) Subject: invalid-assign testcase for non-lvalue stores X-Git-Tag: 0.1-rc1~5 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=951c37cc718f9800d9338bdffc541902c2848ba8;p=xonotic%2Fgmqcc.git invalid-assign testcase for non-lvalue stores --- diff --git a/testsuite/Makefile b/testsuite/Makefile index 669ba57..d238455 100644 --- a/testsuite/Makefile +++ b/testsuite/Makefile @@ -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 index 0000000..264ea5a --- /dev/null +++ b/testsuite/invalid-assign/main.qc @@ -0,0 +1,4 @@ +void() main = { + local float x; + x + 3 = 5; +};