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).

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?

Looks good otherwise, thanks, but I think we should try to support
the line above if we can.

Richard

Reply via email to