aboutsummaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl/glcpp/tests
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2018-10-10 11:03:47 +1100
committerTimothy Arceri <[email protected]>2018-10-10 15:08:32 +1100
commit0346ad37741b11d640c1c4970b275c1f0c7f9e75 (patch)
tree6e10da82ec0d579dd29d897e73903996d4af7d8c /src/compiler/glsl/glcpp/tests
parentb44c9292b7e5a24e6b06a197d4e72b43a8799d09 (diff)
glsl: ignore trailing whitespace when define redefined
The Nvidia/AMD binary drivers allow this, as does GCC. This fixes shader compilation issues in the latest update of No Mans Sky. Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/compiler/glsl/glcpp/tests')
-rw-r--r--src/compiler/glsl/glcpp/tests/122-redefine-whitespace.c4
-rw-r--r--src/compiler/glsl/glcpp/tests/122-redefine-whitespace.c.expected10
2 files changed, 11 insertions, 3 deletions
diff --git a/src/compiler/glsl/glcpp/tests/122-redefine-whitespace.c b/src/compiler/glsl/glcpp/tests/122-redefine-whitespace.c
index ae7ea09f67e..2b084e0960a 100644
--- a/src/compiler/glsl/glcpp/tests/122-redefine-whitespace.c
+++ b/src/compiler/glsl/glcpp/tests/122-redefine-whitespace.c
@@ -2,6 +2,7 @@
#define TWO ( 1+1 )
#define FOUR (2 + 2)
#define SIX (3 + 3)
+#define EIGHT (8 + 8)
/* Redefinitions with whitespace in same places, but different amounts, (so no
* error). */
@@ -9,6 +10,9 @@
#define FOUR (2 + 2)
#define SIX (3/*comment is whitespace*/+ /* collapsed */ /* to */ /* one */ /* space */ 3)
+/* Trailing whitespace (no error) */
+#define EIGHT (8 + 8)
+
/* Redefinitions with whitespace in different places. Each of these should
* trigger an error. */
#define TWO (1 + 1)
diff --git a/src/compiler/glsl/glcpp/tests/122-redefine-whitespace.c.expected b/src/compiler/glsl/glcpp/tests/122-redefine-whitespace.c.expected
index 602bdef94c2..766849e34a9 100644
--- a/src/compiler/glsl/glcpp/tests/122-redefine-whitespace.c.expected
+++ b/src/compiler/glsl/glcpp/tests/122-redefine-whitespace.c.expected
@@ -1,14 +1,15 @@
-0:14(9): preprocessor error: Redefinition of macro TWO
+0:18(9): preprocessor error: Redefinition of macro TWO
-0:15(9): preprocessor error: Redefinition of macro FOUR
+0:19(9): preprocessor error: Redefinition of macro FOUR
-0:16(9): preprocessor error: Redefinition of macro SIX
+0:20(9): preprocessor error: Redefinition of macro SIX
+
@@ -18,5 +19,8 @@
+
+
+