Fix up dg-set-compiler-env-var

Jakub Jelinek jakub@redhat.com
Thu Jun 2 12:33:00 GMT 2016


On Thu, Jun 02, 2016 at 02:26:28PM +0200, Bernd Schmidt wrote:
> On 06/02/2016 02:19 PM, Jakub Jelinek wrote:
> >The problem is that in cleanup-after-saved-dg-test, there are missing global
> >directives, so when it tests/uses the set_compiler_env_var and
> >saved_compiler_env_var vars to see if it should call
> >restore-compiler-env-var, it uses local (non-existing) vars instead and
> >never restores the env var.
> 
> I'm puzzled how failing to restore the env var causes a failure, but your
> patch is (obviously) ok.

The second of the tests using the new dg-set-compiler-env-var directive is
doing
/* { dg-set-compiler-env-var SOURCE_DATE_EPOCH "AAA" } */
and then expecting an error.  If the env var isn't restored, then on any of
the following testcases that uses __DATE__ and similar macros the env var
contains still AAA and thus results in an error.

	Jakub



More information about the Gcc-patches mailing list