Add GL test for preprocessor stringification
authorTimothy Arceri <tarceri@itsqueeze.com>
Thu, 23 Aug 2018 02:38:56 +0000 (12:38 +1000)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Wed, 26 Sep 2018 09:38:24 +0000 (05:38 -0400)
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."

The test deliberately doesn't make use of VEC4_STRING_PARAM()
because that triggers an invalid type error (passing string to
vec4) on some drivers.
We want to make sure the compile error is triggered by the
preprocessor instead.

Components: OpenGL
VK-GL-CTS issue: 1324

Change-Id: I19838ddc5702aaca377bad9325bb6b21ec2bf30f

external/openglcts/data/gl33/preprocessor.test
external/openglcts/data/mustpass/gl/khronos_mustpass/4.6.1.x/gl33-master.txt
external/openglcts/data/mustpass/gl/khronos_mustpass/4.6.1.x/gl40-master.txt
external/openglcts/data/mustpass/gl/khronos_mustpass/4.6.1.x/gl41-master.txt
external/openglcts/data/mustpass/gl/khronos_mustpass/4.6.1.x/gl42-master.txt
external/openglcts/data/mustpass/gl/khronos_mustpass/4.6.1.x/gl43-master.txt
external/openglcts/data/mustpass/gl/khronos_mustpass/4.6.1.x/gl44-master.txt
external/openglcts/data/mustpass/gl/khronos_mustpass/4.6.1.x/gl45-master.txt
external/openglcts/data/mustpass/gl/khronos_mustpass/4.6.1.x/gl46-master.txt

index 8768602e3cc5bf953a95abd3f6e6b95d5cbcd286..6e855c45f4626ab371e8f2f476bf4b31172fe604 100644 (file)
@@ -174,6 +174,21 @@ group basic "Basic Tests"
                ""
        end
 
+       case stringification
+               version 330
+               expect compile_fail
+               both ""
+                       #version 330
+                       #define VEC4_STRING_PARAM(a, b, c, d) vec4(#a, #b, c, d)
+                       ${DECLARATIONS}
+
+                       void main()
+                       {
+                               ${OUTPUT}
+                       }
+               ""
+       end
+
 end # basic
 
 group definitions "Symbol Definition Tests"
index 0b33ecba95f37f2b51b60450cc5c6593ef7824db..aa22cfd7de3a64793cfe175b87a25228783307f5 100644 (file)
@@ -1498,6 +1498,8 @@ KHR-GL33.shaders.preprocessor.basic.token_pasting_1_vertex
 KHR-GL33.shaders.preprocessor.basic.token_pasting_1_fragment
 KHR-GL33.shaders.preprocessor.basic.token_pasting_2_vertex
 KHR-GL33.shaders.preprocessor.basic.token_pasting_2_fragment
+KHR-GL33.shaders.preprocessor.basic.stringification_vertex
+KHR-GL33.shaders.preprocessor.basic.stringification_fragment
 KHR-GL33.shaders.preprocessor.definitions.define_value_and_function_vertex
 KHR-GL33.shaders.preprocessor.definitions.define_value_and_function_fragment
 KHR-GL33.shaders.preprocessor.definitions.undefine_object_invalid_syntax_vertex
index 3130b9925448e5c25986a1cabdd2ddd27c6660f5..1dbb7933bc7e1767377ad302ce87a3aec07f764a 100644 (file)
@@ -1498,6 +1498,8 @@ KHR-GL40.shaders.preprocessor.basic.token_pasting_1_vertex
 KHR-GL40.shaders.preprocessor.basic.token_pasting_1_fragment
 KHR-GL40.shaders.preprocessor.basic.token_pasting_2_vertex
 KHR-GL40.shaders.preprocessor.basic.token_pasting_2_fragment
+KHR-GL40.shaders.preprocessor.basic.stringification_vertex
+KHR-GL40.shaders.preprocessor.basic.stringification_fragment
 KHR-GL40.shaders.preprocessor.definitions.define_value_and_function_vertex
 KHR-GL40.shaders.preprocessor.definitions.define_value_and_function_fragment
 KHR-GL40.shaders.preprocessor.definitions.undefine_object_invalid_syntax_vertex
index a78dcc9307412930cb7dd48ca328c7869b0bb96b..0d1f3b7500684d503f3444223aeac2bc5c003c92 100644 (file)
@@ -1498,6 +1498,8 @@ KHR-GL41.shaders.preprocessor.basic.token_pasting_1_vertex
 KHR-GL41.shaders.preprocessor.basic.token_pasting_1_fragment
 KHR-GL41.shaders.preprocessor.basic.token_pasting_2_vertex
 KHR-GL41.shaders.preprocessor.basic.token_pasting_2_fragment
+KHR-GL41.shaders.preprocessor.basic.stringification_vertex
+KHR-GL41.shaders.preprocessor.basic.stringification_fragment
 KHR-GL41.shaders.preprocessor.definitions.define_value_and_function_vertex
 KHR-GL41.shaders.preprocessor.definitions.define_value_and_function_fragment
 KHR-GL41.shaders.preprocessor.definitions.undefine_object_invalid_syntax_vertex
index e8e47a04d977e3dc6af2b947a0c22245ab5899d6..87e26ab72e50e7bf9cb8aa8d2fc4f1ad74fdb1bd 100644 (file)
@@ -1498,6 +1498,8 @@ KHR-GL42.shaders.preprocessor.basic.token_pasting_1_vertex
 KHR-GL42.shaders.preprocessor.basic.token_pasting_1_fragment
 KHR-GL42.shaders.preprocessor.basic.token_pasting_2_vertex
 KHR-GL42.shaders.preprocessor.basic.token_pasting_2_fragment
+KHR-GL42.shaders.preprocessor.basic.stringification_vertex
+KHR-GL42.shaders.preprocessor.basic.stringification_fragment
 KHR-GL42.shaders.preprocessor.definitions.define_value_and_function_vertex
 KHR-GL42.shaders.preprocessor.definitions.define_value_and_function_fragment
 KHR-GL42.shaders.preprocessor.definitions.undefine_object_invalid_syntax_vertex
index 68a3cd43b3db45a2e85608ab083016df2fe8c589..e137b7a42980c57ca5c841d3d3ec5d36d2e29293 100644 (file)
@@ -1498,6 +1498,8 @@ KHR-GL43.shaders.preprocessor.basic.token_pasting_1_vertex
 KHR-GL43.shaders.preprocessor.basic.token_pasting_1_fragment
 KHR-GL43.shaders.preprocessor.basic.token_pasting_2_vertex
 KHR-GL43.shaders.preprocessor.basic.token_pasting_2_fragment
+KHR-GL43.shaders.preprocessor.basic.stringification_vertex
+KHR-GL43.shaders.preprocessor.basic.stringification_fragment
 KHR-GL43.shaders.preprocessor.definitions.define_value_and_function_vertex
 KHR-GL43.shaders.preprocessor.definitions.define_value_and_function_fragment
 KHR-GL43.shaders.preprocessor.definitions.undefine_object_invalid_syntax_vertex
index 0e1509c6aa2909501fc02b2df054a530fc6065c9..381ead39a34eaaffb5c1e163fc0a9c2c310f3c45 100644 (file)
@@ -1498,6 +1498,8 @@ KHR-GL44.shaders.preprocessor.basic.token_pasting_1_vertex
 KHR-GL44.shaders.preprocessor.basic.token_pasting_1_fragment
 KHR-GL44.shaders.preprocessor.basic.token_pasting_2_vertex
 KHR-GL44.shaders.preprocessor.basic.token_pasting_2_fragment
+KHR-GL44.shaders.preprocessor.basic.stringification_vertex
+KHR-GL44.shaders.preprocessor.basic.stringification_fragment
 KHR-GL44.shaders.preprocessor.definitions.define_value_and_function_vertex
 KHR-GL44.shaders.preprocessor.definitions.define_value_and_function_fragment
 KHR-GL44.shaders.preprocessor.definitions.undefine_object_invalid_syntax_vertex
index 3e7c7d618864c46e9ea60bb241dff72727719e62..85a40ea2cd7b4b433b73624d75be962ff0701c69 100644 (file)
@@ -1498,6 +1498,8 @@ KHR-GL45.shaders.preprocessor.basic.token_pasting_1_vertex
 KHR-GL45.shaders.preprocessor.basic.token_pasting_1_fragment
 KHR-GL45.shaders.preprocessor.basic.token_pasting_2_vertex
 KHR-GL45.shaders.preprocessor.basic.token_pasting_2_fragment
+KHR-GL45.shaders.preprocessor.basic.stringification_vertex
+KHR-GL45.shaders.preprocessor.basic.stringification_fragment
 KHR-GL45.shaders.preprocessor.definitions.define_value_and_function_vertex
 KHR-GL45.shaders.preprocessor.definitions.define_value_and_function_fragment
 KHR-GL45.shaders.preprocessor.definitions.undefine_object_invalid_syntax_vertex
index aa1c4e99c5a0fb322e5d07656a84d4e30fe63521..c7de73dc35325238f2727e434704b11e0805eb79 100644 (file)
@@ -1498,6 +1498,8 @@ KHR-GL46.shaders.preprocessor.basic.token_pasting_1_vertex
 KHR-GL46.shaders.preprocessor.basic.token_pasting_1_fragment
 KHR-GL46.shaders.preprocessor.basic.token_pasting_2_vertex
 KHR-GL46.shaders.preprocessor.basic.token_pasting_2_fragment
+KHR-GL46.shaders.preprocessor.basic.stringification_vertex
+KHR-GL46.shaders.preprocessor.basic.stringification_fragment
 KHR-GL46.shaders.preprocessor.definitions.define_value_and_function_vertex
 KHR-GL46.shaders.preprocessor.definitions.define_value_and_function_fragment
 KHR-GL46.shaders.preprocessor.definitions.undefine_object_invalid_syntax_vertex