PP/HLSL: Fix #1424: support comma in nested curly braces for macro arg
This commit is contained in:
3
Test/baseResults/hlsl.pp.expand.frag.err
Normal file
3
Test/baseResults/hlsl.pp.expand.frag.err
Normal file
@@ -0,0 +1,3 @@
|
||||
ERROR: HLSL currently only supported when requesting SPIR-V for Vulkan.
|
||||
ERROR: HLSL currently only supported when requesting SPIR-V for Vulkan.
|
||||
|
||||
18
Test/baseResults/hlsl.pp.expand.frag.out
Normal file
18
Test/baseResults/hlsl.pp.expand.frag.out
Normal file
@@ -0,0 +1,18 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
struct A
|
||||
{
|
||||
float4 a;
|
||||
float4 b;
|
||||
float4 c = { 1, 2, 3, 4 };
|
||||
float4 d = {({ {(({ 1, 2, 3, 4 }))} })}, { { 1, 2, 3, 4 } };
|
||||
};
|
||||
|
||||
void main()
|
||||
{
|
||||
}
|
||||
|
||||
17
Test/hlsl.pp.expand.frag
Executable file
17
Test/hlsl.pp.expand.frag
Executable file
@@ -0,0 +1,17 @@
|
||||
#define EMP1(a)
|
||||
#define EMP2(a, b)
|
||||
|
||||
#define EXP1(a) = a
|
||||
#define EXP2(a, b) = a, b
|
||||
|
||||
struct A
|
||||
{
|
||||
float4 a EMP1({1,2,3,4}); // No PP arg errors
|
||||
float4 b EMP2({({{(({1,2,3,4}))}})}, {{1,2,3,4}}); // No PP arg errors
|
||||
float4 c EXP1({1,2,3,4}); // ERROR: No PP arg errors, but init error
|
||||
float4 d EXP2({({{(({1,2,3,4}))}})}, {{1,2,3,4}}); // ERROR: No PP arg errors, but init error
|
||||
};
|
||||
|
||||
void main()
|
||||
{
|
||||
}
|
||||
@@ -215,6 +215,13 @@ $EXE -H -e main -D -Od -fhlsl_functionality1 hlsl.noSemantic.functionality1.comp
|
||||
$TARGETDIR/hlsl.noSemantic.functionality1.comp.out
|
||||
diff -b $BASEDIR/hlsl.noSemantic.functionality1.comp.out $TARGETDIR/hlsl.noSemantic.functionality1.comp.out || HASERROR=1
|
||||
|
||||
#
|
||||
# Testing HLSL-specific PP feature expansion
|
||||
#
|
||||
$EXE -D -E hlsl.pp.expand.frag > $TARGETDIR/hlsl.pp.expand.frag.out 2> $TARGETDIR/hlsl.pp.expand.frag.err
|
||||
diff -b $BASEDIR/hlsl.pp.expand.frag.out $TARGETDIR/hlsl.pp.expand.frag.out || HASERROR=1
|
||||
diff -b $BASEDIR/hlsl.pp.expand.frag.err $TARGETDIR/hlsl.pp.expand.frag.err || HASERROR=1
|
||||
|
||||
#
|
||||
# Final checking
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user