--- /dev/null
+#version 400\r
+\r
+#define m(a) a\r
+m()
\ No newline at end of file
--- /dev/null
+badMacroArgs.frag
+Warning, version 400 is not yet complete; most version-specific features are present, but some are missing.
+ERROR: 0:4: 'macro expansion' : Too few args in Macro m
+ERROR: 0:4: '' : syntax error
+ERROR: 2 compilation errors. No code generated.
+
+
#define FUNC(a,b) a+b
// needs to be last test in file due to syntax error
-void foo986(){ FUNC( (((2)))), 4); } // ERROR, too many )
+void foo986(){ FUNC( (((2)))), 4); } // ERROR, too few arguments )
rm -f comp.spv frag.spv geom.spv tesc.spv tese.spv vert.spv
+#
+# special tests
+#
+
+$EXE badMacroArgs.frag > $TARGETDIR/badMacroArgs.frag.out
+diff -b $BASEDIR/badMacroArgs.frag.out $TARGETDIR/badMacroArgs.frag.out || HASERROR=1
+
#
# reflection tests
#
TParseContextBase& parseContext;
// Get the next token from *stack* of input sources, popping input sources
- // that are out of tokens, down until an input sources is found that has a token.
+ // that are out of tokens, down until an input source is found that has a token.
// Return EndOfInput when there are no more tokens to be found by doing this.
int scanToken(TPpToken* ppToken)
{
while (! inputStack.empty()) {
token = inputStack.back()->scan(ppToken);
- if (token != EndOfInput)
+ if (token != EndOfInput || inputStack.empty())
break;
popInput();
}
if (ltoken > 127)
ltoken += 128;
switch (ltoken) {
- case '#':
+ case '#':
if (lReadByte(pTok) == '#') {
parseContext.requireProfile(ppToken->loc, ~EEsProfile, "token pasting (##)");
parseContext.profileRequires(ppToken->loc, ~EEsProfile, 130, 0, "token pasting (##)");