mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2024-09-13 09:16:14 -07:00
tests: Add some tests for #ifdef and defined().
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com> Signed-off-by: Matteo Bruni <mbruni@codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
ca28ac17fb
commit
f8ad29aad0
@ -65,6 +65,7 @@ vkd3d_shader_tests = \
|
|||||||
tests/hlsl-vector-indexing-uniform.shader_test \
|
tests/hlsl-vector-indexing-uniform.shader_test \
|
||||||
tests/math.shader_test \
|
tests/math.shader_test \
|
||||||
tests/preproc-if.shader_test \
|
tests/preproc-if.shader_test \
|
||||||
|
tests/preproc-ifdef.shader_test \
|
||||||
tests/swizzle-0.shader_test \
|
tests/swizzle-0.shader_test \
|
||||||
tests/swizzle-1.shader_test \
|
tests/swizzle-1.shader_test \
|
||||||
tests/swizzle-2.shader_test \
|
tests/swizzle-2.shader_test \
|
||||||
@ -208,6 +209,7 @@ XFAIL_TESTS = \
|
|||||||
tests/hlsl-vector-indexing-uniform.shader_test \
|
tests/hlsl-vector-indexing-uniform.shader_test \
|
||||||
tests/math.shader_test \
|
tests/math.shader_test \
|
||||||
tests/preproc-if.shader_test \
|
tests/preproc-if.shader_test \
|
||||||
|
tests/preproc-ifdef.shader_test \
|
||||||
tests/swizzle-0.shader_test \
|
tests/swizzle-0.shader_test \
|
||||||
tests/swizzle-1.shader_test \
|
tests/swizzle-1.shader_test \
|
||||||
tests/swizzle-2.shader_test \
|
tests/swizzle-2.shader_test \
|
||||||
|
89
tests/preproc-ifdef.shader_test
Normal file
89
tests/preproc-ifdef.shader_test
Normal file
@ -0,0 +1,89 @@
|
|||||||
|
[preproc]
|
||||||
|
#define KEY
|
||||||
|
#ifdef KEY
|
||||||
|
pass
|
||||||
|
#endif
|
||||||
|
|
||||||
|
[preproc]
|
||||||
|
#define KEY
|
||||||
|
#if defined(KEY)
|
||||||
|
pass
|
||||||
|
#endif
|
||||||
|
|
||||||
|
[preproc]
|
||||||
|
#define KEY
|
||||||
|
#if defined KEY
|
||||||
|
pass
|
||||||
|
#endif
|
||||||
|
|
||||||
|
[preproc]
|
||||||
|
#ifndef KEY
|
||||||
|
pass
|
||||||
|
#endif
|
||||||
|
|
||||||
|
[preproc]
|
||||||
|
#if !defined(KEY)
|
||||||
|
pass
|
||||||
|
#endif
|
||||||
|
|
||||||
|
[preproc]
|
||||||
|
#define KEY
|
||||||
|
#ifndef KEY
|
||||||
|
fail
|
||||||
|
#else
|
||||||
|
pass
|
||||||
|
#endif
|
||||||
|
|
||||||
|
[preproc]
|
||||||
|
#ifdef KEY
|
||||||
|
fail
|
||||||
|
#else
|
||||||
|
pass
|
||||||
|
#endif
|
||||||
|
|
||||||
|
[preproc]
|
||||||
|
#define KEY(a, b)
|
||||||
|
#ifdef KEY
|
||||||
|
pass
|
||||||
|
#endif
|
||||||
|
|
||||||
|
[preproc]
|
||||||
|
#ifdef KEY
|
||||||
|
fail
|
||||||
|
#endif
|
||||||
|
#define KEY
|
||||||
|
pass
|
||||||
|
|
||||||
|
[preproc]
|
||||||
|
#define KEY 0
|
||||||
|
#ifdef KEY
|
||||||
|
pass
|
||||||
|
#endif
|
||||||
|
|
||||||
|
[preproc]
|
||||||
|
#define KEY
|
||||||
|
#undef KEY
|
||||||
|
#ifndef KEY
|
||||||
|
pass
|
||||||
|
#endif
|
||||||
|
|
||||||
|
[preproc]
|
||||||
|
#if KEY
|
||||||
|
fail
|
||||||
|
#else
|
||||||
|
pass
|
||||||
|
#endif
|
||||||
|
|
||||||
|
[preproc]
|
||||||
|
#if KEY == 0
|
||||||
|
pass
|
||||||
|
#else
|
||||||
|
fail
|
||||||
|
#endif
|
||||||
|
|
||||||
|
[preproc]
|
||||||
|
#if KEY == 1
|
||||||
|
fail
|
||||||
|
#else
|
||||||
|
pass
|
||||||
|
#endif
|
Loading…
Reference in New Issue
Block a user