Stam Markianos-Wright <stam.markianos-wri...@arm.com> writes: > On 1/9/20 4:13 PM, Stam Markianos-Wright wrote: >> On 1/9/20 4:07 PM, Richard Sandiford wrote: >>> Stam Markianos-Wright <stam.markianos-wri...@arm.com> writes: >>>> diff --git a/gcc/testsuite/g++.target/aarch64/bfloat_cpp_typecheck.C >>>> b/gcc/testsuite/g++.target/aarch64/bfloat_cpp_typecheck.C >>>> new file mode 100644 >>>> index 00000000000..55cbb0b0ef7 >>>> --- /dev/null >>>> +++ b/gcc/testsuite/g++.target/aarch64/bfloat_cpp_typecheck.C >>>> @@ -0,0 +1,14 @@ >>>> +/* { dg-do assemble { target { aarch64*-*-* } } } */ >>>> +/* { dg-require-effective-target arm_v8_2a_bf16_neon_ok } */ >>>> +/* { dg-add-options arm_v8_2a_bf16_neon } */ >>>> +/* { dg-additional-options "-O3 --save-temps" } */ >>>> + >>>> +#include <arm_neon.h> >>>> + >>>> +void foo (void) >>>> +{ >>>> + bfloat16_t (); /* { dg-error {invalid conversion to type 'bfloat16_t'} >>>> "" >>>> {target *-*-*} } */ >>> >>> The "" {target *-*-*} stuff isn't needed: that's just for when the test >>> depends on a target selector or if you need to specify a line number >>> (which comes after the target). > > Removed them. > >> >> Ah ok cool. I just had something that worked and was just doing ctrl+c >> ctrl+v >> everywhere! >> >>> >>> Same for the rest of the patch. >>> >>>> + bfloat16_t a = bfloat16_t(); /* { dg-error {invalid conversion to type >>>> 'bfloat16_t'} "" {target *-*-*} } */ >>> >>> Why's this one an error? Looks like it should be OK. Do we build >>> bfloat16_t() as a conversion from a zero integer? >>> >> Yea that's exactly what it looked like when I went into the debugging! But >> will >> investigate a bit further and see if I can fix it for the next revision. >> > > Changed this to dg-bogus with an XFAIL for the purposes of this patch in > Stage 3 :)
Yeah. Like we discussed off-list, we'd need to change the target hook to do this properly. (And if we do change the target hook, it would be good to make it output the errors itself, like we discussed upthread.) Something for GCC 11 perhaps... > diff --git a/gcc/testsuite/g++.target/aarch64/bfloat_cpp_typecheck.C > b/gcc/testsuite/g++.target/aarch64/bfloat_cpp_typecheck.C > new file mode 100644 > index > 0000000000000000000000000000000000000000..0a04cfb18e567ae0eec88da8ea37922434c60080 > --- /dev/null > +++ b/gcc/testsuite/g++.target/aarch64/bfloat_cpp_typecheck.C > @@ -0,0 +1,14 @@ > +/* { dg-do assemble { target { aarch64*-*-* } } } */ > +/* { dg-require-effective-target arm_v8_2a_bf16_neon_ok } */ > +/* { dg-add-options arm_v8_2a_bf16_neon } */ > +/* { dg-additional-options "-O3 --save-temps" } */ > + > +#include <arm_neon.h> > + > +void foo (void) > +{ > + bfloat16_t (); /* { dg-bogus {invalid conversion to type 'bfloat16_t'} "" > { xfail *-*-* } } */ > + bfloat16_t a = bfloat16_t(); /* { dg-error {invalid conversion to type > 'bfloat16_t'} } */ This should be a dg-bogus too. OK with that change, thanks. Richard