summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2014-02-18 09:55:00 -0800
committerIan Romanick <ian.d.romanick@intel.com>2014-02-19 15:06:10 -0800
commit58390b2b38a575913a46f73c0046419017b1f364 (patch)
tree1dffafa359518a45360d8cfa3e53d2a7973ae146
parent3a521d467c108f25b2033132ca6ac665786c0e04 (diff)
glsl-1.30: Expect __ tests to pass
Section 3.3 (Preprocessor) of the GLSL 1.30 spec (and later) and the GLSL ES spec (all versions) say: "All macro names containing two consecutive underscores ( __ ) are reserved for future use as predefined macro names. All macro names prefixed with "GL_" ("GL" followed by a single underscore) are also reserved." The intention is that names containing __ are reserved for internal use by the implementation, and names prefixed with GL_ are reserved for use by Khronos. Since every extension adds a name prefixed with GL_ (i.e., the name of the extension), that should be an error. Names simply containing __ are dangerous to use, but should be allowed. In similar cases, the C++ preprocessor specification says, "no diagnostic is required." Per the Khronos bug mentioned below, a future version of the GLSL specification will clarify this. NOTE: This test will fail on stable Mesa branches until changes to Mesa are picked back. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Cc: Tapani Pälli <lemody@gmail.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71870 Bugzilla: Khronos #11702
-rw-r--r--tests/spec/glsl-1.30/preprocessor/reserved/double-underscore-01.frag10
-rw-r--r--tests/spec/glsl-1.30/preprocessor/reserved/double-underscore-02.frag10
-rw-r--r--tests/spec/glsl-1.30/preprocessor/reserved/double-underscore-03.frag10
3 files changed, 27 insertions, 3 deletions
diff --git a/tests/spec/glsl-1.30/preprocessor/reserved/double-underscore-01.frag b/tests/spec/glsl-1.30/preprocessor/reserved/double-underscore-01.frag
index 6c43fc9b9..38830db50 100644
--- a/tests/spec/glsl-1.30/preprocessor/reserved/double-underscore-01.frag
+++ b/tests/spec/glsl-1.30/preprocessor/reserved/double-underscore-01.frag
@@ -1,5 +1,5 @@
// [config]
-// expect_result: fail
+// expect_result: pass
// glsl_version: 1.30
// [end config]
//
@@ -8,6 +8,14 @@
// From page 11 (17 of pdf) of the GLSL 1.30 spec:
// "All macro names containing two consecutive underscores ( __ ) are
// reserved for future use as predefined macro names."
+//
+// The intention is that names containing __ are reserved for internal
+// use by the implementation, and names prefixed with GL_ are reserved
+// for use by Khronos. Since every extension adds a name prefixed
+// with GL_ (i.e., the name of the extension), that should be an
+// error. Names simply containing __ are dangerous to use, but should
+// be allowed. In similar cases, the C++ preprocessor specification
+// says, "no diagnostic is required."
#version 130
#define __I_AM_RESERVED 1
diff --git a/tests/spec/glsl-1.30/preprocessor/reserved/double-underscore-02.frag b/tests/spec/glsl-1.30/preprocessor/reserved/double-underscore-02.frag
index 3837fc5ec..797a6bf45 100644
--- a/tests/spec/glsl-1.30/preprocessor/reserved/double-underscore-02.frag
+++ b/tests/spec/glsl-1.30/preprocessor/reserved/double-underscore-02.frag
@@ -1,5 +1,5 @@
// [config]
-// expect_result: fail
+// expect_result: pass
// glsl_version: 1.30
// [end config]
//
@@ -8,6 +8,14 @@
// From page 11 (17 of pdf) of the GLSL 1.30 spec:
// "All macro names containing two consecutive underscores ( __ ) are
// reserved for future use as predefined macro names."
+//
+// The intention is that names containing __ are reserved for internal
+// use by the implementation, and names prefixed with GL_ are reserved
+// for use by Khronos. Since every extension adds a name prefixed
+// with GL_ (i.e., the name of the extension), that should be an
+// error. Names simply containing __ are dangerous to use, but should
+// be allowed. In similar cases, the C++ preprocessor specification
+// says, "no diagnostic is required."
#version 130
#define I_AM_RESERVED__ 1
diff --git a/tests/spec/glsl-1.30/preprocessor/reserved/double-underscore-03.frag b/tests/spec/glsl-1.30/preprocessor/reserved/double-underscore-03.frag
index dabda65cc..505d06980 100644
--- a/tests/spec/glsl-1.30/preprocessor/reserved/double-underscore-03.frag
+++ b/tests/spec/glsl-1.30/preprocessor/reserved/double-underscore-03.frag
@@ -1,5 +1,5 @@
// [config]
-// expect_result: fail
+// expect_result: pass
// glsl_version: 1.30
// [end config]
//
@@ -9,6 +9,14 @@
// From page 11 (17 of pdf) of the GLSL 1.30 spec:
// "All macro names containing two consecutive underscores ( __ ) are
// reserved for future use as predefined macro names."
+//
+// The intention is that names containing __ are reserved for internal
+// use by the implementation, and names prefixed with GL_ are reserved
+// for use by Khronos. Since every extension adds a name prefixed
+// with GL_ (i.e., the name of the extension), that should be an
+// error. Names simply containing __ are dangerous to use, but should
+// be allowed. In similar cases, the C++ preprocessor specification
+// says, "no diagnostic is required."
#version 130
#define I__AM__RESERVED 1