yum-mirror/slang
Making it easier to work with shaders
git clone https://git.yummers.dev/yum-mirror/slang
58d7af37f
master
1// macro-parens-from-expansion.slang 2//DIAGNOSTIC_TEST:SIMPLE:-E 3 4// This test covers a case where the parentheses for 5// a function-like macro invocation argument list are 6// themselves produced by a macro invocation. 7// 8// In the below code, it is important that the macros 9// `LPAREN` and `RPAREN` are not considered busy for 10// the invocation of `INNER`, despite the fact that 11// both of those macros were expanded as part of 12// producing the arguments to the `INNER` invocation. 13 14#define LPAREN ( 15#define RPAREN ) 16#define INNER(X) LPAREN X RPAREN 17#define M(X) X 18#define OUTER(X) M( INNER LPAREN X RPAREN ) 19 20// output: ( 3 ) 21OUTER(3)