[Piglit] [PATCH] glsl-1.10: add some preprocessor stringification tests

Timothy Arceri tarceri at itsqueeze.com
Wed Aug 29 01:33:30 UTC 2018


>From Section 3.3. (Preprocessor) of the GLSL 4.60 spec:

    "The following operators are also available:
        defined
        ##
    ...

    Any directive not listed above will cause a compile-time error."
---
 .../stringification-in-unreachable-branch.frag       | 12 ++++++++++++
 .../compiler/preprocessor/stringification.frag       | 10 ++++++++++
 2 files changed, 22 insertions(+)
 create mode 100644 tests/spec/glsl-1.10/compiler/preprocessor/stringification-in-unreachable-branch.frag
 create mode 100644 tests/spec/glsl-1.10/compiler/preprocessor/stringification.frag

diff --git a/tests/spec/glsl-1.10/compiler/preprocessor/stringification-in-unreachable-branch.frag b/tests/spec/glsl-1.10/compiler/preprocessor/stringification-in-unreachable-branch.frag
new file mode 100644
index 000000000..32b1798b8
--- /dev/null
+++ b/tests/spec/glsl-1.10/compiler/preprocessor/stringification-in-unreachable-branch.frag
@@ -0,0 +1,12 @@
+// [config]
+// expect_result: pass
+// glsl_version: 1.10
+// [end config]
+
+#version 110
+
+#ifdef this_is_undefined
+#define VEC4_STRING_PARAM(a, b, c, d) vec4(#a, #b, c, d)
+#endif
+
+void main() { }
diff --git a/tests/spec/glsl-1.10/compiler/preprocessor/stringification.frag b/tests/spec/glsl-1.10/compiler/preprocessor/stringification.frag
new file mode 100644
index 000000000..617ad102d
--- /dev/null
+++ b/tests/spec/glsl-1.10/compiler/preprocessor/stringification.frag
@@ -0,0 +1,10 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.10
+// [end config]
+
+#version 110
+
+#define VEC4_STRING_PARAM(a, b, c, d) vec4(#a, #b, c, d)
+
+void main() { }
-- 
2.17.1



More information about the Piglit mailing list