diff mbox

Move effective target check after other directives in c-c++-common/cpp/openmp-define-3.c

Message ID 525BC6CD.5070505@arm.com
State New
Headers show

Commit Message

Kyrylo Tkachov Oct. 14, 2013, 10:26 a.m. UTC
Hi all,

This minuscule patch moves the dg-require-effective-target fopenmp line after 
the other directives in the c-c++-common/cpp/openmp-define-3.c test. Otherwise 
dejagnu still proceeds to add -fopenmp to the options which fails on bare metal 
arm and aarch64 targets.

[cc'ing Thomas because he added the test and Jakub because he merged the OpenMP 
support recently]

Ok to commit to trunk?

Thanks,
Kyrill

Comments

Mike Stump Oct. 14, 2013, 9:12 p.m. UTC | #1
On Oct 14, 2013, at 3:26 AM, Kyrill Tkachov <kyrylo.tkachov@arm.com> wrote:
> This minuscule patch moves the dg-require-effective-target fopenmp line after the other directives in the c-c++-common/cpp/openmp-define-3.c test. Otherwise dejagnu still proceeds to add -fopenmp to the options which fails on bare metal arm and aarch64 targets.
> 
> [cc'ing Thomas because he added the test and Jakub because he merged the OpenMP support recently]
> 
> Ok to commit to trunk?

Ok.
Thomas Schwinge Oct. 16, 2013, 9:25 a.m. UTC | #2
Hi!

On Mon, 14 Oct 2013 11:26:21 +0100, Kyrill Tkachov <kyrylo.tkachov@arm.com> wrote:
> This minuscule patch moves the dg-require-effective-target fopenmp line after 
> the other directives in the c-c++-common/cpp/openmp-define-3.c test. Otherwise 
> dejagnu still proceeds to add -fopenmp to the options which fails on bare metal 
> arm and aarch64 targets.

Thanks for reporting and fixing this -- I had not been aware of the
ordering requirements of dg-* directives.  From gcc/doc/sourcebuild.texi:

    @item @{ dg-require-effective-target @var{keyword} [@{ @var{selector} @}] @}
    Skip the test if [...]
    This directive must appear after any @code{dg-do} directive in the test
    and before any @code{dg-additional-sources} directive.
    [...]

> --- a/gcc/testsuite/c-c++-common/cpp/openmp-define-3.c
> +++ b/gcc/testsuite/c-c++-common/cpp/openmp-define-3.c
> @@ -1,6 +1,6 @@
> -/* { dg-require-effective-target fopenmp } */
>  /* { dg-options "-fopenmp" } */
>  /* { dg-do preprocess } */
> +/* { dg-require-effective-target fopenmp } */

The other testsuite files that I added in r203417 should also be adapted
accordingly.  Do you want to do that, or want me to do it?


Grüße,
 Thomas
Kyrylo Tkachov Oct. 16, 2013, 9:54 a.m. UTC | #3
Hi Thomas,
>> --- a/gcc/testsuite/c-c++-common/cpp/openmp-define-3.c
>> +++ b/gcc/testsuite/c-c++-common/cpp/openmp-define-3.c
>> @@ -1,6 +1,6 @@
>> -/* { dg-require-effective-target fopenmp } */
>>   /* { dg-options "-fopenmp" } */
>>   /* { dg-do preprocess } */
>> +/* { dg-require-effective-target fopenmp } */
> The other testsuite files that I added in r203417 should also be adapted
> accordingly.  Do you want to do that, or want me to do it?
I'll leave the honors to you :)

Kyrill

>
>
> Grüße,
>   Thomas
diff mbox

Patch

diff --git a/gcc/testsuite/c-c++-common/cpp/openmp-define-3.c b/gcc/testsuite/c-c++-common/cpp/openmp-define-3.c
index 601a1c3..6986c55 100644
--- a/gcc/testsuite/c-c++-common/cpp/openmp-define-3.c
+++ b/gcc/testsuite/c-c++-common/cpp/openmp-define-3.c
@@ -1,6 +1,6 @@ 
-/* { dg-require-effective-target fopenmp } */
 /* { dg-options "-fopenmp" } */
 /* { dg-do preprocess } */
+/* { dg-require-effective-target fopenmp } */
 
 #ifndef _OPENMP
 # error _OPENMP not defined