Bug 98522

Summary: dEQP mandates preprocessor tests for define defined
Product: Mesa Reporter: Kenneth Graunke <kenneth>
Component: Drivers/DRI/i965Assignee: Ian Romanick <idr>
Status: RESOLVED NOTOURBUG QA Contact: Intel 3D Bugs Mailing List <intel-3d-bugs>
Severity: normal    
Priority: medium CC: randy.xu
Version: git   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Bug Depends on:    
Bug Blocks: 94448    

Description Kenneth Graunke 2016-10-31 22:46:39 UTC
We fail the following tests on the dEQP nougat-cts-dev mustpass list:

dEQP-GLES3.functional.shaders.preprocessor.conditional_inclusion.defined_macro_defined_test_fragment
dEQP-GLES3.functional.shaders.preprocessor.conditional_inclusion.defined_macro_defined_test_vertex
Comment 1 Kenneth Graunke 2016-10-31 22:46:54 UTC
See also:
https://cvs.khronos.org/bugzilla/show_bug.cgi?id=15567#c28
Comment 2 Ian Romanick 2016-10-31 23:25:55 UTC
I think https://cvs.khronos.org/bugzilla/show_bug.cgi?id=15567#c22 matches what dEQP expects.  Basically, C explicitly allows

#define derp defined

According to https://cvs.khronos.org/bugzilla/show_bug.cgi?id=15567#c21, C says that the following is undefined, but c22 says that all tested C compiler "do the right thing":

#if derp herp

Just from peeking over Ken's shoulder, I think this is the behavior that dEQP expects.  As far as I'm aware, WebGL expects errors for this, but GLSL ES and desktop GLSL have left it also undefined.

I think we should accept these, but we should probably generate warnings.  I think the warning should occur in the #if line.  I believe this is what glslang does in its permissive mode.
Comment 3 Ian Romanick 2016-10-31 23:26:34 UTC
Also... I think everyone agrees that

#define defined derp

is an error.
Comment 4 Kenneth Graunke 2017-02-03 09:24:40 UTC
These were blacklisted from dEQP in dEQP/AOSP commit e5f74834175e076b46f5c002a2e2d17274cc5db9 on the nougat-cts-dev branch, because they're testing undefined behavior.  Therefore, NOTOURBUG.

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.