Bug 97307

Summary: glsl/glcpp/tests/glcpp-test regression
Product: Mesa Reporter: Vinson Lee <vlee>
Component: glsl-compilerAssignee: Kenneth Graunke <kenneth>
Status: RESOLVED FIXED QA Contact: mesa-dev
Severity: normal    
Priority: medium CC: idr, t_arceri
Version: gitKeywords: bisected, regression
Hardware: x86-64 (AMD64)   
OS: All   
i915 platform: i915 features:

Description Vinson Lee 2016-08-11 20:30:57 UTC
mesa: 17f1c49b9ad05af4f6482f6fa950e5dcc1a779d1 (master 12.1.0-devel)

Testing ./glsl/glcpp/tests/120-undef-builtin.c... > src/compiler/glsl/glcpp/tests/120-undef-builtin.c.out (./glsl/glcpp/tests/120-undef-builtin.c.expected) FAIL
--- ./glsl/glcpp/tests/120-undef-builtin.c.expected     2016-01-26 09:59:33.017797268 -0800
+++ src/compiler/glsl/glcpp/tests/120-undef-builtin.c.out  2016-08-11 10:30:15.630875304 -0700
@@ -1,6 +1,3 @@
-0:1(1): preprocessor error: Built-in (pre-defined) macro names cannot be undefined.
-0:2(1): preprocessor error: Built-in (pre-defined) macro names cannot be undefined.
-0:3(1): preprocessor error: Built-in (pre-defined) macro names cannot be undefined.

50b49d242d702e4728329cc59f87d929963e7c53 is the first bad commit
commit 50b49d242d702e4728329cc59f87d929963e7c53
Author: Ian Romanick <ian.d.romanick@intel.com>
Date:   Tue Aug 9 14:32:24 2016 -0700

    glcpp: Only disallow #undef of pre-defined macros on GLSL ES >= 3.00 shaders
    Section 3.4 (Preprocessor) of the GLSL ES 3.00 spec says:
       It is an error to undefine or to redefine a built-in (pre-defined)
       macro name.
    The GLSL ES 1.00 spec does not contain this text.
    Section 3.3 (Preprocessor) of the GLSL 1.30 spec says:
       #define and #undef functionality are defined as is standard for C++
       preprocessors for macro definitions both with and without macro
    At least as far as I can tell GCC allow '#undef __FILE__'.  Furthermore,
    there are desktop OpenGL conformance tests that expect '#undef
    __VERSION__' and '#undef GL_core_profile' to work.
    Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
    Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
    Cc: mesa-stable@lists.freedesktop.org

:040000 040000 fbe8d2e45f4f1e6755e70b6e6f8fa971701e3ae8 d7c77a29d8aa922a28948df34eca499077eaac45 M	src
bisect run success
Comment 1 Ian Romanick 2016-08-12 22:43:13 UTC
I'll just need to update the test.  Ideally I'd like to be able to test version-specific behavior, but I'm not sure the standalone preprocessor can do that.
Comment 3 Kenneth Graunke 2016-08-16 05:58:33 UTC
Fixed by:

commit 1f47f78fc3193ecff13799305a8e35af82e68a06
Author: Kenneth Graunke <kenneth@whitecape.org>
Date:   Sun Aug 14 21:00:31 2016 -0700

    glcpp: Update tests for new #undef of built-in macro rules.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.