public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Tweak diagnostic-token.ranges.c testcase (PR testsuite/71865)
@ 2016-07-14 14:55 Jakub Jelinek
  2016-07-14 18:29 ` David Malcolm
  0 siblings, 1 reply; 3+ messages in thread
From: Jakub Jelinek @ 2016-07-14 14:55 UTC (permalink / raw)
  To: Joseph S. Myers, Marek Polacek, David Malcolm; +Cc: gcc-patches

Hi!

As mentioned in the PR, this testcase behaves differently on
powerpc*/spu/s390* targets, because in non-iso modes they predefine
conditional macros like bool and that affects the behavior of the
suggestions.

We should certainly discuss what to do with the conditional macros,
but in the mean time IMHO it doesn't hurt to just avoid this
problem.

Tested on x86_64-linux and i686-linux, ok for trunk?

2016-07-14  Jakub Jelinek  <jakub@redhat.com>

	PR testsuite/71865
	* gcc.dg/diagnostic-token-ranges.c: Add -std=c11 to dg-options.
	(wide_string_literal_in_asm): Use __asm instead of asm, adjust
	expected diagnostics.

--- gcc/testsuite/gcc.dg/diagnostic-token-ranges.c.jj	2016-07-14 11:06:23.000000000 +0200
+++ gcc/testsuite/gcc.dg/diagnostic-token-ranges.c	2016-07-14 14:47:50.399907380 +0200
@@ -1,4 +1,4 @@
-/* { dg-options "-fdiagnostics-show-caret -Wc++-compat" } */
+/* { dg-options "-fdiagnostics-show-caret -Wc++-compat -std=c11" } */
 
 /* Verify that various diagnostics show source code ranges.  */
 
@@ -68,11 +68,11 @@ foo (unknown_type param); /* { dg-error
 
 void wide_string_literal_in_asm (void)
 {
-  asm (L"nop"); /* { dg-error "wide string literal in 'asm'" } */
+  __asm (L"nop"); /* { dg-error "wide string literal in 'asm'" } */
 /*
 { dg-begin-multiline-output "" }
-   asm (L"nop");
-        ^~~~~~
+   __asm (L"nop");
+          ^~~~~~
 { dg-end-multiline-output "" }
 */
 }

	Jakub

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Tweak diagnostic-token.ranges.c testcase (PR testsuite/71865)
  2016-07-14 14:55 [PATCH] Tweak diagnostic-token.ranges.c testcase (PR testsuite/71865) Jakub Jelinek
@ 2016-07-14 18:29 ` David Malcolm
  2016-07-14 18:51   ` Jakub Jelinek
  0 siblings, 1 reply; 3+ messages in thread
From: David Malcolm @ 2016-07-14 18:29 UTC (permalink / raw)
  To: Jakub Jelinek, Joseph S. Myers, Marek Polacek; +Cc: gcc-patches

On Thu, 2016-07-14 at 16:55 +0200, Jakub Jelinek wrote:
> Hi!
> 
> As mentioned in the PR, this testcase behaves differently on
> powerpc*/spu/s390* targets, because in non-iso modes they predefine
> conditional macros like bool and that affects the behavior of the
> suggestions.
> 
> We should certainly discuss what to do with the conditional macros,
> but in the mean time IMHO it doesn't hurt to just avoid this
> problem.
> 
> Tested on x86_64-linux and i686-linux, ok for trunk?

Thanks.  I think I can approve this with my "libcpp/diagnostic messages
" maintainer hat on.

Did you test the case with a build for one of the affected targets to
verify the fix?

> 2016-07-14  Jakub Jelinek  <jakub@redhat.com>
> 
> 	PR testsuite/71865
> 	* gcc.dg/diagnostic-token-ranges.c: Add -std=c11 to dg-options.
> 	(wide_string_literal_in_asm): Use __asm instead of asm, adjust
> 	expected diagnostics.
> 
> --- gcc/testsuite/gcc.dg/diagnostic-token-ranges.c.jj	2016-07
> -14 11:06:23.000000000 +0200
> +++ gcc/testsuite/gcc.dg/diagnostic-token-ranges.c	2016-07-14
> 14:47:50.399907380 +0200
> @@ -1,4 +1,4 @@
> -/* { dg-options "-fdiagnostics-show-caret -Wc++-compat" } */
> +/* { dg-options "-fdiagnostics-show-caret -Wc++-compat -std=c11" }
> */
>  
>  /* Verify that various diagnostics show source code ranges.  */
>  
> @@ -68,11 +68,11 @@ foo (unknown_type param); /* { dg-error
>  
>  void wide_string_literal_in_asm (void)
>  {
> -  asm (L"nop"); /* { dg-error "wide string literal in 'asm'" } */
> +  __asm (L"nop"); /* { dg-error "wide string literal in 'asm'" } */
>  /*
>  { dg-begin-multiline-output "" }
> -   asm (L"nop");
> -        ^~~~~~
> +   __asm (L"nop");
> +          ^~~~~~
>  { dg-end-multiline-output "" }
>  */
>  }
> 
> 	Jakub

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Tweak diagnostic-token.ranges.c testcase (PR testsuite/71865)
  2016-07-14 18:29 ` David Malcolm
@ 2016-07-14 18:51   ` Jakub Jelinek
  0 siblings, 0 replies; 3+ messages in thread
From: Jakub Jelinek @ 2016-07-14 18:51 UTC (permalink / raw)
  To: David Malcolm; +Cc: Joseph S. Myers, Marek Polacek, gcc-patches

On Thu, Jul 14, 2016 at 02:29:10PM -0400, David Malcolm wrote:
> > Tested on x86_64-linux and i686-linux, ok for trunk?
> 
> Thanks.  I think I can approve this with my "libcpp/diagnostic messages
> " maintainer hat on.
> 
> Did you test the case with a build for one of the affected targets to
> verify the fix?

Tested just with the cross-compiler to powerpc64le-linux besides
x86_64/i686 bootstrap/regtests, in the cross it fails without the patch
and succeeds with it.  Change committed.

> > 2016-07-14  Jakub Jelinek  <jakub@redhat.com>
> > 
> > 	PR testsuite/71865
> > 	* gcc.dg/diagnostic-token-ranges.c: Add -std=c11 to dg-options.
> > 	(wide_string_literal_in_asm): Use __asm instead of asm, adjust
> > 	expected diagnostics.

	Jakub

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-07-14 18:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-14 14:55 [PATCH] Tweak diagnostic-token.ranges.c testcase (PR testsuite/71865) Jakub Jelinek
2016-07-14 18:29 ` David Malcolm
2016-07-14 18:51   ` Jakub Jelinek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).