diff mbox series

[testsuite] Require ucn support in gdc.test/compilable/ddoc12.d (PR d/88039)

Message ID yddsgzmkels.fsf@CeBiTec.Uni-Bielefeld.DE
State New
Headers show
Series [testsuite] Require ucn support in gdc.test/compilable/ddoc12.d (PR d/88039) | expand

Commit Message

Rainer Orth Nov. 27, 2018, 10:18 a.m. UTC
Some assemblers, including the Solaris one, don't support UTF-8
identifiers, which breaks the gdc.test/compilable/ddoc12.d testcase as
reported in the PR.

Since we don't want to modify the upstream testcase directly, I've
instead modified the gdc.test driver to require ucn support via a
dg-require-effective-target directive, based on the file name.

Tested on i386-pc-solaris2.11 with gas (which does support them and the
test still PASSes) and sparc-sun-solaris2.11 with as (which doesn't, so
the test turns out as UNSUPPORTED).

Ok for mainline?

	Rainer

Comments

Mike Stump Nov. 27, 2018, 7:10 p.m. UTC | #1
On Nov 27, 2018, at 2:18 AM, Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> wrote:
> 
> Some assemblers, including the Solaris one, don't support UTF-8
> identifiers, which breaks the gdc.test/compilable/ddoc12.d testcase as
> reported in the PR.

So, another style of fix, would be to change the binding from the language front-end to encode unsupported symbols using a fixed, documented, abi defined technique.
Rainer Orth Nov. 27, 2018, 7:32 p.m. UTC | #2
Hi Mike,

> On Nov 27, 2018, at 2:18 AM, Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> wrote:
>> 
>> Some assemblers, including the Solaris one, don't support UTF-8
>> identifiers, which breaks the gdc.test/compilable/ddoc12.d testcase as
>> reported in the PR.
>
> So, another style of fix, would be to change the binding from the language
> front-end to encode unsupported symbols using a fixed, documented, abi
> defined technique.

there's been some discussion on this in the PR.  Joseph's suggestion was
to follow the system compilers if this were done, and indeed they do
encode UTF-8 identifiers in some way which could either be
reverse-engineered or a spec obtained.  However, given Iain's stance
towards UTF-8 identifiers in D, I very much doubt this is worth the
effort.  Ultimately, it's his call, of course.

	Rainer
Iain Buclaw Nov. 28, 2018, 10:39 p.m. UTC | #3
On Tue, 27 Nov 2018 at 20:32, Rainer Orth <ro@cebitec.uni-bielefeld.de> wrote:
>
> Hi Mike,
>
> > On Nov 27, 2018, at 2:18 AM, Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> wrote:
> >>
> >> Some assemblers, including the Solaris one, don't support UTF-8
> >> identifiers, which breaks the gdc.test/compilable/ddoc12.d testcase as
> >> reported in the PR.
> >
> > So, another style of fix, would be to change the binding from the language
> > front-end to encode unsupported symbols using a fixed, documented, abi
> > defined technique.
>
> there's been some discussion on this in the PR.  Joseph's suggestion was
> to follow the system compilers if this were done, and indeed they do
> encode UTF-8 identifiers in some way which could either be
> reverse-engineered or a spec obtained.  However, given Iain's stance
> towards UTF-8 identifiers in D, I very much doubt this is worth the
> effort.  Ultimately, it's his call, of course.
>

Not only my stance, but as a whole just how those maintaining the core
language generally agree on. Encoding UTF8 characters in symbols is
not part of the D ABI, so that is something that needs convincing
upstream.

There is a third way however, all compilable/ddoc* tests don't
actually require us to compile the module all the way down to object
code, the only thing that really needs to be tested is the Ddoc
generator itself.  Which would be setting 'dg-do-what compile' and
build with the compiler option -fdoc, then dg-final checks for the
presence of the file ddoc12.html is the minimum that needs to be done
for these tests to be considered passed.

I'll have a look into doing it that way tomorrow.

--
Iain
Rainer Orth Nov. 29, 2018, 2:12 p.m. UTC | #4
Hi Iain,

> On Tue, 27 Nov 2018 at 20:32, Rainer Orth <ro@cebitec.uni-bielefeld.de> wrote:
>>
>> Hi Mike,
>>
>> > On Nov 27, 2018, at 2:18 AM, Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
>> > wrote:
>> >>
>> >> Some assemblers, including the Solaris one, don't support UTF-8
>> >> identifiers, which breaks the gdc.test/compilable/ddoc12.d testcase as
>> >> reported in the PR.
>> >
>> > So, another style of fix, would be to change the binding from the language
>> > front-end to encode unsupported symbols using a fixed, documented, abi
>> > defined technique.
>>
>> there's been some discussion on this in the PR.  Joseph's suggestion was
>> to follow the system compilers if this were done, and indeed they do
>> encode UTF-8 identifiers in some way which could either be
>> reverse-engineered or a spec obtained.  However, given Iain's stance
>> towards UTF-8 identifiers in D, I very much doubt this is worth the
>> effort.  Ultimately, it's his call, of course.
>>
>
> Not only my stance, but as a whole just how those maintaining the core
> language generally agree on. Encoding UTF8 characters in symbols is
> not part of the D ABI, so that is something that needs convincing
> upstream.
>
> There is a third way however, all compilable/ddoc* tests don't
> actually require us to compile the module all the way down to object
> code, the only thing that really needs to be tested is the Ddoc
> generator itself.  Which would be setting 'dg-do-what compile' and
> build with the compiler option -fdoc, then dg-final checks for the
> presence of the file ddoc12.html is the minimum that needs to be done
> for these tests to be considered passed.
>
> I'll have a look into doing it that way tomorrow.

that would be even better of course, also saving some testing time.

Thanks.
	Rainer
Iain Buclaw Dec. 1, 2018, 6:28 p.m. UTC | #5
On Thu, 29 Nov 2018 at 15:12, Rainer Orth <ro@cebitec.uni-bielefeld.de> wrote:
>
> Hi Iain,
>
> > On Tue, 27 Nov 2018 at 20:32, Rainer Orth <ro@cebitec.uni-bielefeld.de> wrote:
> >>
> >> Hi Mike,
> >>
> >> > On Nov 27, 2018, at 2:18 AM, Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
> >> > wrote:
> >> >>
> >> >> Some assemblers, including the Solaris one, don't support UTF-8
> >> >> identifiers, which breaks the gdc.test/compilable/ddoc12.d testcase as
> >> >> reported in the PR.
> >> >
> >> > So, another style of fix, would be to change the binding from the language
> >> > front-end to encode unsupported symbols using a fixed, documented, abi
> >> > defined technique.
> >>
> >> there's been some discussion on this in the PR.  Joseph's suggestion was
> >> to follow the system compilers if this were done, and indeed they do
> >> encode UTF-8 identifiers in some way which could either be
> >> reverse-engineered or a spec obtained.  However, given Iain's stance
> >> towards UTF-8 identifiers in D, I very much doubt this is worth the
> >> effort.  Ultimately, it's his call, of course.
> >>
> >
> > Not only my stance, but as a whole just how those maintaining the core
> > language generally agree on. Encoding UTF8 characters in symbols is
> > not part of the D ABI, so that is something that needs convincing
> > upstream.
> >
> > There is a third way however, all compilable/ddoc* tests don't
> > actually require us to compile the module all the way down to object
> > code, the only thing that really needs to be tested is the Ddoc
> > generator itself.  Which would be setting 'dg-do-what compile' and
> > build with the compiler option -fdoc, then dg-final checks for the
> > presence of the file ddoc12.html is the minimum that needs to be done
> > for these tests to be considered passed.
> >
> > I'll have a look into doing it that way tomorrow.
>
> that would be even better of course, also saving some testing time.
>

Hi Rainer,

Attached patch for it, I've checked that and it does the right thing
and passes on x86_64.

There's a couple more changes than just testsuite files, as compiling
with -fdoc unearthed bug fixes not backported from the D version of
the compiler.  These I'll apply separately.
Iain Buclaw Dec. 2, 2018, 11:52 a.m. UTC | #6
On Sat, 1 Dec 2018 at 19:28, Iain Buclaw <ibuclaw@gdcproject.org> wrote:
>
> On Thu, 29 Nov 2018 at 15:12, Rainer Orth <ro@cebitec.uni-bielefeld.de> wrote:
> >
> > Hi Iain,
> >
> > > On Tue, 27 Nov 2018 at 20:32, Rainer Orth <ro@cebitec.uni-bielefeld.de> wrote:
> > >>
> > >> Hi Mike,
> > >>
> > >> > On Nov 27, 2018, at 2:18 AM, Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
> > >> > wrote:
> > >> >>
> > >> >> Some assemblers, including the Solaris one, don't support UTF-8
> > >> >> identifiers, which breaks the gdc.test/compilable/ddoc12.d testcase as
> > >> >> reported in the PR.
> > >> >
> > >> > So, another style of fix, would be to change the binding from the language
> > >> > front-end to encode unsupported symbols using a fixed, documented, abi
> > >> > defined technique.
> > >>
> > >> there's been some discussion on this in the PR.  Joseph's suggestion was
> > >> to follow the system compilers if this were done, and indeed they do
> > >> encode UTF-8 identifiers in some way which could either be
> > >> reverse-engineered or a spec obtained.  However, given Iain's stance
> > >> towards UTF-8 identifiers in D, I very much doubt this is worth the
> > >> effort.  Ultimately, it's his call, of course.
> > >>
> > >
> > > Not only my stance, but as a whole just how those maintaining the core
> > > language generally agree on. Encoding UTF8 characters in symbols is
> > > not part of the D ABI, so that is something that needs convincing
> > > upstream.
> > >
> > > There is a third way however, all compilable/ddoc* tests don't
> > > actually require us to compile the module all the way down to object
> > > code, the only thing that really needs to be tested is the Ddoc
> > > generator itself.  Which would be setting 'dg-do-what compile' and
> > > build with the compiler option -fdoc, then dg-final checks for the
> > > presence of the file ddoc12.html is the minimum that needs to be done
> > > for these tests to be considered passed.
> > >
> > > I'll have a look into doing it that way tomorrow.
> >
> > that would be even better of course, also saving some testing time.
> >
>
> Hi Rainer,
>
> Attached patch for it, I've checked that and it does the right thing
> and passes on x86_64.
>
> There's a couple more changes than just testsuite files, as compiling
> with -fdoc unearthed bug fixes not backported from the D version of
> the compiler.  These I'll apply separately.
>

D2 front-end and testsuite changes have been upstreamed/downstreamed.
If there's no complaint, I'll apply the dejagnu fix as well.
Rainer Orth Dec. 4, 2018, 1:49 p.m. UTC | #7
Hi Iain,

> On Sat, 1 Dec 2018 at 19:28, Iain Buclaw <ibuclaw@gdcproject.org> wrote:
>>
>> On Thu, 29 Nov 2018 at 15:12, Rainer Orth <ro@cebitec.uni-bielefeld.de> wrote:
>> >
>> > Hi Iain,
>> >
>> > > On Tue, 27 Nov 2018 at 20:32, Rainer Orth
>> > > <ro@cebitec.uni-bielefeld.de> wrote:
>> > >>
>> > >> Hi Mike,
>> > >>
>> > >> > On Nov 27, 2018, at 2:18 AM, Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
>> > >> > wrote:
>> > >> >>
>> > >> >> Some assemblers, including the Solaris one, don't support UTF-8
>> > >> >> identifiers, which breaks the gdc.test/compilable/ddoc12.d testcase as
>> > >> >> reported in the PR.
>> > >> >
>> > >> > So, another style of fix, would be to change the binding from the
>> > >> > language
>> > >> > front-end to encode unsupported symbols using a fixed, documented, abi
>> > >> > defined technique.
>> > >>
>> > >> there's been some discussion on this in the PR.  Joseph's suggestion was
>> > >> to follow the system compilers if this were done, and indeed they do
>> > >> encode UTF-8 identifiers in some way which could either be
>> > >> reverse-engineered or a spec obtained.  However, given Iain's stance
>> > >> towards UTF-8 identifiers in D, I very much doubt this is worth the
>> > >> effort.  Ultimately, it's his call, of course.
>> > >>
>> > >
>> > > Not only my stance, but as a whole just how those maintaining the core
>> > > language generally agree on. Encoding UTF8 characters in symbols is
>> > > not part of the D ABI, so that is something that needs convincing
>> > > upstream.
>> > >
>> > > There is a third way however, all compilable/ddoc* tests don't
>> > > actually require us to compile the module all the way down to object
>> > > code, the only thing that really needs to be tested is the Ddoc
>> > > generator itself.  Which would be setting 'dg-do-what compile' and
>> > > build with the compiler option -fdoc, then dg-final checks for the
>> > > presence of the file ddoc12.html is the minimum that needs to be done
>> > > for these tests to be considered passed.
>> > >
>> > > I'll have a look into doing it that way tomorrow.
>> >
>> > that would be even better of course, also saving some testing time.
>> >
>>
>> Hi Rainer,
>>
>> Attached patch for it, I've checked that and it does the right thing
>> and passes on x86_64.
>>
>> There's a couple more changes than just testsuite files, as compiling
>> with -fdoc unearthed bug fixes not backported from the D version of
>> the compiler.  These I'll apply separately.
>>
>
> D2 front-end and testsuite changes have been upstreamed/downstreamed.
> If there's no complaint, I'll apply the dejagnu fix as well.

not at all: I've checked it on i386-pc-solaris2.11/gas and
sparc-sun-solaris2.12/as and compilable/ddoc12.d now PASSes on both, so
the gdc-test.exp part is ok.  Please mention PR d/88039 in the
ChangeLog.

Thanks.
        Rainer
Iain Buclaw Dec. 9, 2018, 7:57 p.m. UTC | #8
On Tue, 4 Dec 2018 at 14:49, Rainer Orth <ro@cebitec.uni-bielefeld.de> wrote:
>
> Hi Iain,
>
> > On Sat, 1 Dec 2018 at 19:28, Iain Buclaw <ibuclaw@gdcproject.org> wrote:
> >>
> >> On Thu, 29 Nov 2018 at 15:12, Rainer Orth <ro@cebitec.uni-bielefeld.de> wrote:
> >> >
> >> > Hi Iain,
> >> >
> >> > > On Tue, 27 Nov 2018 at 20:32, Rainer Orth
> >> > > <ro@cebitec.uni-bielefeld.de> wrote:
> >> > >>
> >> > >> Hi Mike,
> >> > >>
> >> > >> > On Nov 27, 2018, at 2:18 AM, Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
> >> > >> > wrote:
> >> > >> >>
> >> > >> >> Some assemblers, including the Solaris one, don't support UTF-8
> >> > >> >> identifiers, which breaks the gdc.test/compilable/ddoc12.d testcase as
> >> > >> >> reported in the PR.
> >> > >> >
> >> > >> > So, another style of fix, would be to change the binding from the
> >> > >> > language
> >> > >> > front-end to encode unsupported symbols using a fixed, documented, abi
> >> > >> > defined technique.
> >> > >>
> >> > >> there's been some discussion on this in the PR.  Joseph's suggestion was
> >> > >> to follow the system compilers if this were done, and indeed they do
> >> > >> encode UTF-8 identifiers in some way which could either be
> >> > >> reverse-engineered or a spec obtained.  However, given Iain's stance
> >> > >> towards UTF-8 identifiers in D, I very much doubt this is worth the
> >> > >> effort.  Ultimately, it's his call, of course.
> >> > >>
> >> > >
> >> > > Not only my stance, but as a whole just how those maintaining the core
> >> > > language generally agree on. Encoding UTF8 characters in symbols is
> >> > > not part of the D ABI, so that is something that needs convincing
> >> > > upstream.
> >> > >
> >> > > There is a third way however, all compilable/ddoc* tests don't
> >> > > actually require us to compile the module all the way down to object
> >> > > code, the only thing that really needs to be tested is the Ddoc
> >> > > generator itself.  Which would be setting 'dg-do-what compile' and
> >> > > build with the compiler option -fdoc, then dg-final checks for the
> >> > > presence of the file ddoc12.html is the minimum that needs to be done
> >> > > for these tests to be considered passed.
> >> > >
> >> > > I'll have a look into doing it that way tomorrow.
> >> >
> >> > that would be even better of course, also saving some testing time.
> >> >
> >>
> >> Hi Rainer,
> >>
> >> Attached patch for it, I've checked that and it does the right thing
> >> and passes on x86_64.
> >>
> >> There's a couple more changes than just testsuite files, as compiling
> >> with -fdoc unearthed bug fixes not backported from the D version of
> >> the compiler.  These I'll apply separately.
> >>
> >
> > D2 front-end and testsuite changes have been upstreamed/downstreamed.
> > If there's no complaint, I'll apply the dejagnu fix as well.
>
> not at all: I've checked it on i386-pc-solaris2.11/gas and
> sparc-sun-solaris2.12/as and compilable/ddoc12.d now PASSes on both, so
> the gdc-test.exp part is ok.  Please mention PR d/88039 in the
> ChangeLog.
>

Done, and committed in r266933.
diff mbox series

Patch

# HG changeset patch
# Parent  c94c294504322187c207bc70ad6734280adc7043
Require ucn support in gdc.test/compilable/ddoc12.d (PR d/88039)

diff --git a/gcc/testsuite/gdc.test/gdc-test.exp b/gcc/testsuite/gdc.test/gdc-test.exp
--- a/gcc/testsuite/gdc.test/gdc-test.exp
+++ b/gcc/testsuite/gdc.test/gdc-test.exp
@@ -276,6 +276,14 @@  proc dmd2dg { base test } {
     # Since GCC 6-20160131 blank lines are not allowed in the output by default.
     dg-allow-blank-lines-in-output { 1 }
 
+    # Require UCN support for tests with UCN identifiers.
+    switch $test {
+	compilable/ddoc12.d {
+	    set out_line "// { dg-require-effective-target ucn }"
+	    puts $fdout $out_line
+	}
+    }
+
     # Compilable files are successful if an output is generated.
     # Fail compilable are successful if an output is not generated.
     # Runnable must compile, link, and return 0 to be successful by default.