Bug 106807 - Failed to parse macro "#line"
Summary: Failed to parse macro "#line"
Alias: None
Product: Mesa
Classification: Unclassified
Component: glsl-compiler (show other bugs)
Version: 17.1
Hardware: ARM Linux (All)
: medium normal
Assignee: mesa-dev
QA Contact: Intel 3D Bugs Mailing List
Depends on:
Reported: 2018-06-04 08:00 UTC by Zhaowei Yuan
Modified: 2018-06-14 08:19 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Description Zhaowei Yuan 2018-06-04 08:00:12 UTC
GLES CTS test case:
checks if GLSL compiler can parse macro "#line" successfully, following is the shader code:
    precision mediump float;
    attribute highp vec4 dEQP_Position;
    varying float out0;

    void main()
        #line +20
        out0 = float(__LINE__);
	gl_Position = dEQP_Position;

yyerror() will be called while parsing #line which casue the case fails
Comment 1 Kenneth Graunke 2018-06-04 09:03:32 UTC
I don't have links to details handy, but sometime between September 20-22, 2017 Khronos voted to make #line expression behavior undefined (including failure to parse), with the intention of making it explicitly an error in future GLSL versions.

This test is invalid and should be removed from dEQP.  We will not accept patches to implement this behavior in Mesa.

Historically, some people shipped a hack to make this invalid test pass:

The right thing to do now is delete the test.
Comment 2 Juan A. Suarez 2018-06-14 08:19:55 UTC
As Kenneth said, Khronos voted to consider #line with an expression as undefined behaviour, and thus these tests were removed


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.