mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2025-02-21 02:40:56 +00:00
invalid-assign testcase for non-lvalue stores
This commit is contained in:
parent
0fedee8312
commit
951c37cc71
2 changed files with 13 additions and 1 deletions
|
@ -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
|
||||
|
|
4
testsuite/invalid-assign/main.qc
Normal file
4
testsuite/invalid-assign/main.qc
Normal file
|
@ -0,0 +1,4 @@
|
|||
void() main = {
|
||||
local float x;
|
||||
x + 3 = 5;
|
||||
};
|
Loading…
Reference in a new issue