Tests: Add test for ways of calling no-argument macro with ().

This commit is contained in:
John Kessenich
2018-11-06 14:51:27 -07:00
parent 1c1c2d643a
commit 8b782e77df
2 changed files with 60 additions and 0 deletions

30
Test/preprocessor.simple.vert Normal file → Executable file
View File

@@ -27,3 +27,33 @@ int main() {
+= -= *= /= %= <<= >>= &= |= ^=
1.2 2E10 5u -5lf
}
struct S {
int member1;
float member2;
vec4 member3;
};
#define xyz xxyz
#define yzy() yyz
#define LIGHTING_COMMON_BRDF() \
vec3 a = vec3(0); \
vec3 b = a.zxyz; \
vec3 b = a.xyz; \
vec3 b = a.yzy(); \
vec3 b = a.xyz(); \
vec3 b = a.yzy; \
vec3 b = a.z;
void foo()
{
S s;
s.member2 + s.member1;
s.member3.zyx;
s.member2.xyz;
s.member2.yzy();
s.member2.xyz();
s.member2.yzy;
LIGHTING_COMMON_BRDF()
}