Re: [Piglit] [PATCH 1/2] glslparsertest: Added some few more struct construction tests

2016-08-11 Thread Dylan Baker
Quoting Timothy Arceri (2016-08-11 18:05:08)
> On Thu, 2016-08-11 at 17:49 -0700, Dylan Baker wrote:
> > Quoting Timothy Arceri (2016-08-11 17:39:19)
> > > 
> > > On Thu, 2016-08-11 at 10:43 -0700, Dylan Baker wrote:
> > > > 
> > > > Quoting Timothy Arceri (2016-08-08 20:14:31)
> > > > > 
> > > > > 
> > > > > On Fri, 2016-08-05 at 17:43 +0300, Andres Gomez wrote:
> > > > > > 
> > > > > > 
> > > > > > This set focus on checking invalid structs construction.
> > > > > > Specifically,
> > > > > > adds a test to check that only implicit conversions are
> > > > > > perform
> > > > > > and
> > > > > > vector conversions of the type vec3 to vec2 through dropping
> > > > > > the
> > > > > > z
> > > > > > component are not allowed.
> > > > > 
> > > > > 
> > > > > IMO we should try to avoid adding more tests to these
> > > > > directories.
> > > > > 
> > > > > I would much rather these be added to tests/spec/glsl-
> > > > > 1.20/compiler/constructor/
> > > > > 
> > > > > I would then name them struct-1.vert .. struct-N.vert
> > > > > 
> > > > > It's up to you if you want to move/rename the existing
> > > > > contructor
> > > > > tests
> > > > > but eventually I think this is something we should do.
> > > > 
> > > > IIRC Brian had requested that the whole folder be moved in one go
> > > > rather
> > > > than piecemeal to ease tracking regressions (the same for
> > > > shaders/
> > > > and
> > > > other non-sorted folders).
> > > 
> > > shaders/ contains c programs so I can see it being a bit more
> > > tricky
> > > but the tests in glslparsertest should only require a 'git mv'
> > > where we
> > > put it in the appropriate folder and rename it with a more
> > > descritive
> > > name.
> > > 
> > > I don't think there is any real problem with regression tracking
> > > here
> > > that moving in one go will solve.
> > 
> > I means you only have to know that commit xzy moves all of these
> > tests,
> > as opposed to tests 1-10 were moved a week ago, 11-30 were moved two
> > months ago, etc...
> 
> I see. Well I'd be surprised if someone sat down and moved all 500~
> tests in one go rather than multiple people chipping away at it. But I
> guess we will see :)

I might have a branch for that somewhere... ;)

> 
> > 
> > > 
> > > 
> > > > 
> > > >  And if we do it in one big go we can actually
> > > > have the python framework rename the tests for us, making it
> > > > seamless.
> > > > 
> > > > Dylan
> > > > ___
> > > > Piglit mailing list
> > > > Piglit@lists.freedesktop.org
> > > > https://lists.freedesktop.org/mailman/listinfo/piglit
> > ___
> > Piglit mailing list
> > Piglit@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/piglit


signature.asc
Description: signature
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH 1/2] glslparsertest: Added some few more struct construction tests

2016-08-11 Thread Timothy Arceri
On Thu, 2016-08-11 at 17:49 -0700, Dylan Baker wrote:
> Quoting Timothy Arceri (2016-08-11 17:39:19)
> > 
> > On Thu, 2016-08-11 at 10:43 -0700, Dylan Baker wrote:
> > > 
> > > Quoting Timothy Arceri (2016-08-08 20:14:31)
> > > > 
> > > > 
> > > > On Fri, 2016-08-05 at 17:43 +0300, Andres Gomez wrote:
> > > > > 
> > > > > 
> > > > > This set focus on checking invalid structs construction.
> > > > > Specifically,
> > > > > adds a test to check that only implicit conversions are
> > > > > perform
> > > > > and
> > > > > vector conversions of the type vec3 to vec2 through dropping
> > > > > the
> > > > > z
> > > > > component are not allowed.
> > > > 
> > > > 
> > > > IMO we should try to avoid adding more tests to these
> > > > directories.
> > > > 
> > > > I would much rather these be added to tests/spec/glsl-
> > > > 1.20/compiler/constructor/
> > > > 
> > > > I would then name them struct-1.vert .. struct-N.vert
> > > > 
> > > > It's up to you if you want to move/rename the existing
> > > > contructor
> > > > tests
> > > > but eventually I think this is something we should do.
> > > 
> > > IIRC Brian had requested that the whole folder be moved in one go
> > > rather
> > > than piecemeal to ease tracking regressions (the same for
> > > shaders/
> > > and
> > > other non-sorted folders).
> > 
> > shaders/ contains c programs so I can see it being a bit more
> > tricky
> > but the tests in glslparsertest should only require a 'git mv'
> > where we
> > put it in the appropriate folder and rename it with a more
> > descritive
> > name.
> > 
> > I don't think there is any real problem with regression tracking
> > here
> > that moving in one go will solve.
> 
> I means you only have to know that commit xzy moves all of these
> tests,
> as opposed to tests 1-10 were moved a week ago, 11-30 were moved two
> months ago, etc...

I see. Well I'd be surprised if someone sat down and moved all 500~
tests in one go rather than multiple people chipping away at it. But I
guess we will see :)

> 
> > 
> > 
> > > 
> > >  And if we do it in one big go we can actually
> > > have the python framework rename the tests for us, making it
> > > seamless.
> > > 
> > > Dylan
> > > ___
> > > Piglit mailing list
> > > Piglit@lists.freedesktop.org
> > > https://lists.freedesktop.org/mailman/listinfo/piglit
> ___
> Piglit mailing list
> Piglit@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/piglit
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH 1/2] glslparsertest: Added some few more struct construction tests

2016-08-11 Thread Dylan Baker
Quoting Timothy Arceri (2016-08-11 17:39:19)
> On Thu, 2016-08-11 at 10:43 -0700, Dylan Baker wrote:
> > Quoting Timothy Arceri (2016-08-08 20:14:31)
> > > 
> > > On Fri, 2016-08-05 at 17:43 +0300, Andres Gomez wrote:
> > > > 
> > > > This set focus on checking invalid structs construction.
> > > > Specifically,
> > > > adds a test to check that only implicit conversions are perform
> > > > and
> > > > vector conversions of the type vec3 to vec2 through dropping the
> > > > z
> > > > component are not allowed.
> > > 
> > > 
> > > IMO we should try to avoid adding more tests to these directories.
> > > 
> > > I would much rather these be added to tests/spec/glsl-
> > > 1.20/compiler/constructor/
> > > 
> > > I would then name them struct-1.vert .. struct-N.vert
> > > 
> > > It's up to you if you want to move/rename the existing contructor
> > > tests
> > > but eventually I think this is something we should do.
> > 
> > IIRC Brian had requested that the whole folder be moved in one go
> > rather
> > than piecemeal to ease tracking regressions (the same for shaders/
> > and
> > other non-sorted folders).
> 
> shaders/ contains c programs so I can see it being a bit more tricky
> but the tests in glslparsertest should only require a 'git mv' where we
> put it in the appropriate folder and rename it with a more descritive
> name.
> 
> I don't think there is any real problem with regression tracking here
> that moving in one go will solve.

I means you only have to know that commit xzy moves all of these tests,
as opposed to tests 1-10 were moved a week ago, 11-30 were moved two
months ago, etc...

> 
> >  And if we do it in one big go we can actually
> > have the python framework rename the tests for us, making it
> > seamless.
> > 
> > Dylan
> > ___
> > Piglit mailing list
> > Piglit@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/piglit


signature.asc
Description: signature
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH 1/2] glslparsertest: Added some few more struct construction tests

2016-08-11 Thread Timothy Arceri
On Thu, 2016-08-11 at 10:43 -0700, Dylan Baker wrote:
> Quoting Timothy Arceri (2016-08-08 20:14:31)
> > 
> > On Fri, 2016-08-05 at 17:43 +0300, Andres Gomez wrote:
> > > 
> > > This set focus on checking invalid structs construction.
> > > Specifically,
> > > adds a test to check that only implicit conversions are perform
> > > and
> > > vector conversions of the type vec3 to vec2 through dropping the
> > > z
> > > component are not allowed.
> > 
> > 
> > IMO we should try to avoid adding more tests to these directories.
> > 
> > I would much rather these be added to tests/spec/glsl-
> > 1.20/compiler/constructor/
> > 
> > I would then name them struct-1.vert .. struct-N.vert
> > 
> > It's up to you if you want to move/rename the existing contructor
> > tests
> > but eventually I think this is something we should do.
> 
> IIRC Brian had requested that the whole folder be moved in one go
> rather
> than piecemeal to ease tracking regressions (the same for shaders/
> and
> other non-sorted folders).

shaders/ contains c programs so I can see it being a bit more tricky
but the tests in glslparsertest should only require a 'git mv' where we
put it in the appropriate folder and rename it with a more descritive
name.

I don't think there is any real problem with regression tracking here
that moving in one go will solve.

>  And if we do it in one big go we can actually
> have the python framework rename the tests for us, making it
> seamless.
> 
> Dylan
> ___
> Piglit mailing list
> Piglit@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/piglit
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH 1/2] glslparsertest: Added some few more struct construction tests

2016-08-11 Thread Dylan Baker
Quoting Timothy Arceri (2016-08-08 20:14:31)
> On Fri, 2016-08-05 at 17:43 +0300, Andres Gomez wrote:
> > This set focus on checking invalid structs construction.
> > Specifically,
> > adds a test to check that only implicit conversions are perform and
> > vector conversions of the type vec3 to vec2 through dropping the z
> > component are not allowed.
> 
> 
> IMO we should try to avoid adding more tests to these directories.
> 
> I would much rather these be added to tests/spec/glsl-
> 1.20/compiler/constructor/
> 
> I would then name them struct-1.vert .. struct-N.vert
> 
> It's up to you if you want to move/rename the existing contructor tests
> but eventually I think this is something we should do.

IIRC Brian had requested that the whole folder be moved in one go rather
than piecemeal to ease tracking regressions (the same for shaders/ and
other non-sorted folders). And if we do it in one big go we can actually
have the python framework rename the tests for us, making it seamless.

Dylan


signature.asc
Description: signature
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH 1/2] glslparsertest: Added some few more struct construction tests

2016-08-11 Thread Andres Gomez
On Tue, 2016-08-09 at 13:14 +1000, Timothy Arceri wrote:
> On Fri, 2016-08-05 at 17:43 +0300, Andres Gomez wrote:
> > This set focus on checking invalid structs construction.
> > Specifically,
> > adds a test to check that only implicit conversions are perform and
> > vector conversions of the type vec3 to vec2 through dropping the z
> > component are not allowed.
> 
> 
> IMO we should try to avoid adding more tests to these directories.
> 
> I would much rather these be added to tests/spec/glsl-
> 1.20/compiler/constructor/
> 
> I would then name them struct-1.vert .. struct-N.vert

Let's do that, then.

> It's up to you if you want to move/rename the existing contructor tests
> but eventually I think this is something we should do.

I'll note it down in my TODO for later. I'd rather push this now as it
is.

> With the above and my comment below addressed you can add to this
> patch:
> 
> Acked-by: Timothy Arceri 

Thanks!

> > ---
> >  tests/glslparsertest/glsl2/constructor-29.vert | 13 +
> >  tests/glslparsertest/glsl2/constructor-30.vert | 13 +
> >  tests/glslparsertest/glsl2/constructor-31.vert | 15 +++
> >  tests/glslparsertest/glsl2/constructor-32.vert | 15 +++
> >  tests/glslparsertest/glsl2/constructor-33.vert | 15 +++
> >  tests/glslparsertest/glsl2/constructor-34.vert | 15 +++
> >  6 files changed, 86 insertions(+)
> >  create mode 100644 tests/glslparsertest/glsl2/constructor-29.vert
> >  create mode 100644 tests/glslparsertest/glsl2/constructor-30.vert
> >  create mode 100644 tests/glslparsertest/glsl2/constructor-31.vert
> >  create mode 100644 tests/glslparsertest/glsl2/constructor-32.vert
> >  create mode 100644 tests/glslparsertest/glsl2/constructor-33.vert
> >  create mode 100644 tests/glslparsertest/glsl2/constructor-34.vert
> > 
> > diff --git a/tests/glslparsertest/glsl2/constructor-29.vert
> > b/tests/glslparsertest/glsl2/constructor-29.vert
> > new file mode 100644
> > index 000..eecab51
> > --- /dev/null
> > +++ b/tests/glslparsertest/glsl2/constructor-29.vert
> > @@ -0,0 +1,13 @@
> > +// [config]
> > +// expect_result: fail
> > +// glsl_version: 1.20
> > +// [end config]
> > +
> > +/* FAIL */
> > +#version 120
> > +struct s { vec2 f; };
> > +
> > +void main()
> > +{
> > +s t = s(vec3(1.0, 3.0, 0.0)); // Only Section 4.1.10 “Implicit
> > Conversions.” are allowed
> > +}
> > diff --git a/tests/glslparsertest/glsl2/constructor-30.vert
> > b/tests/glslparsertest/glsl2/constructor-30.vert
> > new file mode 100644
> > index 000..eecab51
> > --- /dev/null
> > +++ b/tests/glslparsertest/glsl2/constructor-30.vert
> > @@ -0,0 +1,13 @@
> > +// [config]
> > +// expect_result: fail
> > +// glsl_version: 1.20
> > +// [end config]
> > +
> > +/* FAIL */
> > +#version 120
> > +struct s { vec2 f; };
> > +
> > +void main()
> > +{
> > +s t = s(vec3(1.0, 3.0, 0.0)); // Only Section 4.1.10 “Implicit
> > Conversions.” are allowed
> > +}
> > diff --git a/tests/glslparsertest/glsl2/constructor-31.vert
> > b/tests/glslparsertest/glsl2/constructor-31.vert
> > new file mode 100644
> > index 000..fafaf85
> > --- /dev/null
> > +++ b/tests/glslparsertest/glsl2/constructor-31.vert
> > @@ -0,0 +1,15 @@
> > +// [config]
> > +// expect_result: fail
> > +// glsl_version: 1.20
> > +// [end config]
> > +
> > +/* FAIL */
> > +#version 120
> > +struct s1 { float f; };
> > +
> > +struct s2 { s1 g; };
> > +
> > +void main()
> > +{
> > +s2 t = s2(1); // Only Section 4.1.10 “Implicit Conversions.” are
> > allowed
> > +}
> > diff --git a/tests/glslparsertest/glsl2/constructor-32.vert
> > b/tests/glslparsertest/glsl2/constructor-32.vert
> > new file mode 100644
> > index 000..b27dcac
> > --- /dev/null
> > +++ b/tests/glslparsertest/glsl2/constructor-32.vert
> > @@ -0,0 +1,15 @@
> > +// [config]
> > +// expect_result: fail
> > +// glsl_version: 1.20
> > +// [end config]
> > +
> > +/* FAIL */
> > +#version 120
> > +struct s1 { float f; };
> > +
> > +struct s2 { s1 g; };
> 
> 
> Please remove s2
> 
> 
> > +
> > +void main()
> > +{
> > +s1 t = s1(s1(1)); // Only Section 4.1.10 “Implicit Conversions.”
> > are allowed
> > +}
> > diff --git a/tests/glslparsertest/glsl2/constructor-33.vert
> > b/tests/glslparsertest/glsl2/constructor-33.vert
> > new file mode 100644
> > index 000..46add14
> > --- /dev/null
> > +++ b/tests/glslparsertest/glsl2/constructor-33.vert
> > @@ -0,0 +1,15 @@
> > +// [config]
> > +// expect_result: fail
> > +// glsl_version: 1.20
> > +// [end config]
> > +
> > +/* FAIL */
> > +#version 120
> > +struct s1 { float f; };
> > +
> > +struct s2 { s1 g; };
> > +
> > +void main()
> > +{
> > +s2 t = s2(s2(s1(1))); // Only Section 4.1.10 “Implicit
> > Conversions.” are allowed
> > +}
> > diff --git a/tests/glslparsertest/glsl2/constructor-34.vert
> > b/tests/glslparsertest/glsl2/constructor-34.vert
> > new file mode 100644
> > index 000..46f1c27
> > --- /dev/null
> > +++ b/tests/glslparsertest/glsl2/constru

Re: [Piglit] [PATCH 1/2] glslparsertest: Added some few more struct construction tests

2016-08-08 Thread Timothy Arceri
On Fri, 2016-08-05 at 17:43 +0300, Andres Gomez wrote:
> This set focus on checking invalid structs construction.
> Specifically,
> adds a test to check that only implicit conversions are perform and
> vector conversions of the type vec3 to vec2 through dropping the z
> component are not allowed.


IMO we should try to avoid adding more tests to these directories.

I would much rather these be added to tests/spec/glsl-
1.20/compiler/constructor/

I would then name them struct-1.vert .. struct-N.vert

It's up to you if you want to move/rename the existing contructor tests
but eventually I think this is something we should do.

With the above and my comment below addressed you can add to this
patch:

Acked-by: Timothy Arceri 

> ---
>  tests/glslparsertest/glsl2/constructor-29.vert | 13 +
>  tests/glslparsertest/glsl2/constructor-30.vert | 13 +
>  tests/glslparsertest/glsl2/constructor-31.vert | 15 +++
>  tests/glslparsertest/glsl2/constructor-32.vert | 15 +++
>  tests/glslparsertest/glsl2/constructor-33.vert | 15 +++
>  tests/glslparsertest/glsl2/constructor-34.vert | 15 +++
>  6 files changed, 86 insertions(+)
>  create mode 100644 tests/glslparsertest/glsl2/constructor-29.vert
>  create mode 100644 tests/glslparsertest/glsl2/constructor-30.vert
>  create mode 100644 tests/glslparsertest/glsl2/constructor-31.vert
>  create mode 100644 tests/glslparsertest/glsl2/constructor-32.vert
>  create mode 100644 tests/glslparsertest/glsl2/constructor-33.vert
>  create mode 100644 tests/glslparsertest/glsl2/constructor-34.vert
> 
> diff --git a/tests/glslparsertest/glsl2/constructor-29.vert
> b/tests/glslparsertest/glsl2/constructor-29.vert
> new file mode 100644
> index 000..eecab51
> --- /dev/null
> +++ b/tests/glslparsertest/glsl2/constructor-29.vert
> @@ -0,0 +1,13 @@
> +// [config]
> +// expect_result: fail
> +// glsl_version: 1.20
> +// [end config]
> +
> +/* FAIL */
> +#version 120
> +struct s { vec2 f; };
> +
> +void main()
> +{
> +s t = s(vec3(1.0, 3.0, 0.0)); // Only Section 4.1.10 “Implicit
> Conversions.” are allowed
> +}
> diff --git a/tests/glslparsertest/glsl2/constructor-30.vert
> b/tests/glslparsertest/glsl2/constructor-30.vert
> new file mode 100644
> index 000..eecab51
> --- /dev/null
> +++ b/tests/glslparsertest/glsl2/constructor-30.vert
> @@ -0,0 +1,13 @@
> +// [config]
> +// expect_result: fail
> +// glsl_version: 1.20
> +// [end config]
> +
> +/* FAIL */
> +#version 120
> +struct s { vec2 f; };
> +
> +void main()
> +{
> +s t = s(vec3(1.0, 3.0, 0.0)); // Only Section 4.1.10 “Implicit
> Conversions.” are allowed
> +}
> diff --git a/tests/glslparsertest/glsl2/constructor-31.vert
> b/tests/glslparsertest/glsl2/constructor-31.vert
> new file mode 100644
> index 000..fafaf85
> --- /dev/null
> +++ b/tests/glslparsertest/glsl2/constructor-31.vert
> @@ -0,0 +1,15 @@
> +// [config]
> +// expect_result: fail
> +// glsl_version: 1.20
> +// [end config]
> +
> +/* FAIL */
> +#version 120
> +struct s1 { float f; };
> +
> +struct s2 { s1 g; };
> +
> +void main()
> +{
> +s2 t = s2(1); // Only Section 4.1.10 “Implicit Conversions.” are
> allowed
> +}
> diff --git a/tests/glslparsertest/glsl2/constructor-32.vert
> b/tests/glslparsertest/glsl2/constructor-32.vert
> new file mode 100644
> index 000..b27dcac
> --- /dev/null
> +++ b/tests/glslparsertest/glsl2/constructor-32.vert
> @@ -0,0 +1,15 @@
> +// [config]
> +// expect_result: fail
> +// glsl_version: 1.20
> +// [end config]
> +
> +/* FAIL */
> +#version 120
> +struct s1 { float f; };
> +
> +struct s2 { s1 g; };


Please remove s2


> +
> +void main()
> +{
> +s1 t = s1(s1(1)); // Only Section 4.1.10 “Implicit Conversions.”
> are allowed
> +}
> diff --git a/tests/glslparsertest/glsl2/constructor-33.vert
> b/tests/glslparsertest/glsl2/constructor-33.vert
> new file mode 100644
> index 000..46add14
> --- /dev/null
> +++ b/tests/glslparsertest/glsl2/constructor-33.vert
> @@ -0,0 +1,15 @@
> +// [config]
> +// expect_result: fail
> +// glsl_version: 1.20
> +// [end config]
> +
> +/* FAIL */
> +#version 120
> +struct s1 { float f; };
> +
> +struct s2 { s1 g; };
> +
> +void main()
> +{
> +s2 t = s2(s2(s1(1))); // Only Section 4.1.10 “Implicit
> Conversions.” are allowed
> +}
> diff --git a/tests/glslparsertest/glsl2/constructor-34.vert
> b/tests/glslparsertest/glsl2/constructor-34.vert
> new file mode 100644
> index 000..46f1c27
> --- /dev/null
> +++ b/tests/glslparsertest/glsl2/constructor-34.vert
> @@ -0,0 +1,15 @@
> +// [config]
> +// expect_result: pass
> +// glsl_version: 1.20
> +// [end config]
> +
> +/* PASS */
> +#version 120
> +struct s1 { float f; };
> +
> +struct s2 { s1 g; };
> +
> +void main()
> +{
> +s2 t = s2(s1(1)); // an implicit conversion should happen here
> +}
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH 1/2] glslparsertest: Added some few more struct construction tests

2016-08-05 Thread Andres Gomez
This set focus on checking invalid structs construction. Specifically,
adds a test to check that only implicit conversions are perform and
vector conversions of the type vec3 to vec2 through dropping the z
component are not allowed.
---
 tests/glslparsertest/glsl2/constructor-29.vert | 13 +
 tests/glslparsertest/glsl2/constructor-30.vert | 13 +
 tests/glslparsertest/glsl2/constructor-31.vert | 15 +++
 tests/glslparsertest/glsl2/constructor-32.vert | 15 +++
 tests/glslparsertest/glsl2/constructor-33.vert | 15 +++
 tests/glslparsertest/glsl2/constructor-34.vert | 15 +++
 6 files changed, 86 insertions(+)
 create mode 100644 tests/glslparsertest/glsl2/constructor-29.vert
 create mode 100644 tests/glslparsertest/glsl2/constructor-30.vert
 create mode 100644 tests/glslparsertest/glsl2/constructor-31.vert
 create mode 100644 tests/glslparsertest/glsl2/constructor-32.vert
 create mode 100644 tests/glslparsertest/glsl2/constructor-33.vert
 create mode 100644 tests/glslparsertest/glsl2/constructor-34.vert

diff --git a/tests/glslparsertest/glsl2/constructor-29.vert 
b/tests/glslparsertest/glsl2/constructor-29.vert
new file mode 100644
index 000..eecab51
--- /dev/null
+++ b/tests/glslparsertest/glsl2/constructor-29.vert
@@ -0,0 +1,13 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.20
+// [end config]
+
+/* FAIL */
+#version 120
+struct s { vec2 f; };
+
+void main()
+{
+s t = s(vec3(1.0, 3.0, 0.0)); // Only Section 4.1.10 “Implicit 
Conversions.” are allowed
+}
diff --git a/tests/glslparsertest/glsl2/constructor-30.vert 
b/tests/glslparsertest/glsl2/constructor-30.vert
new file mode 100644
index 000..eecab51
--- /dev/null
+++ b/tests/glslparsertest/glsl2/constructor-30.vert
@@ -0,0 +1,13 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.20
+// [end config]
+
+/* FAIL */
+#version 120
+struct s { vec2 f; };
+
+void main()
+{
+s t = s(vec3(1.0, 3.0, 0.0)); // Only Section 4.1.10 “Implicit 
Conversions.” are allowed
+}
diff --git a/tests/glslparsertest/glsl2/constructor-31.vert 
b/tests/glslparsertest/glsl2/constructor-31.vert
new file mode 100644
index 000..fafaf85
--- /dev/null
+++ b/tests/glslparsertest/glsl2/constructor-31.vert
@@ -0,0 +1,15 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.20
+// [end config]
+
+/* FAIL */
+#version 120
+struct s1 { float f; };
+
+struct s2 { s1 g; };
+
+void main()
+{
+s2 t = s2(1); // Only Section 4.1.10 “Implicit Conversions.” are allowed
+}
diff --git a/tests/glslparsertest/glsl2/constructor-32.vert 
b/tests/glslparsertest/glsl2/constructor-32.vert
new file mode 100644
index 000..b27dcac
--- /dev/null
+++ b/tests/glslparsertest/glsl2/constructor-32.vert
@@ -0,0 +1,15 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.20
+// [end config]
+
+/* FAIL */
+#version 120
+struct s1 { float f; };
+
+struct s2 { s1 g; };
+
+void main()
+{
+s1 t = s1(s1(1)); // Only Section 4.1.10 “Implicit Conversions.” are 
allowed
+}
diff --git a/tests/glslparsertest/glsl2/constructor-33.vert 
b/tests/glslparsertest/glsl2/constructor-33.vert
new file mode 100644
index 000..46add14
--- /dev/null
+++ b/tests/glslparsertest/glsl2/constructor-33.vert
@@ -0,0 +1,15 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.20
+// [end config]
+
+/* FAIL */
+#version 120
+struct s1 { float f; };
+
+struct s2 { s1 g; };
+
+void main()
+{
+s2 t = s2(s2(s1(1))); // Only Section 4.1.10 “Implicit Conversions.” are 
allowed
+}
diff --git a/tests/glslparsertest/glsl2/constructor-34.vert 
b/tests/glslparsertest/glsl2/constructor-34.vert
new file mode 100644
index 000..46f1c27
--- /dev/null
+++ b/tests/glslparsertest/glsl2/constructor-34.vert
@@ -0,0 +1,15 @@
+// [config]
+// expect_result: pass
+// glsl_version: 1.20
+// [end config]
+
+/* PASS */
+#version 120
+struct s1 { float f; };
+
+struct s2 { s1 g; };
+
+void main()
+{
+s2 t = s2(s1(1)); // an implicit conversion should happen here
+}
-- 
2.8.1

___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit