diff options
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/c-c++-common/gomp/critical-hint-1.c | 47 | ||||
-rw-r--r-- | gcc/testsuite/c-c++-common/gomp/critical-hint-2.c | 36 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/gomp/critical-hint-1.f90 | 94 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/gomp/critical-hint-2.f90 | 65 |
4 files changed, 0 insertions, 242 deletions
diff --git a/gcc/testsuite/c-c++-common/gomp/critical-hint-1.c b/gcc/testsuite/c-c++-common/gomp/critical-hint-1.c deleted file mode 100644 index 510f8ab..0000000 --- a/gcc/testsuite/c-c++-common/gomp/critical-hint-1.c +++ /dev/null @@ -1,47 +0,0 @@ -#include <omp.h> - -void -example_criticial () -{ - int a, b; - #pragma omp parallel for - for (int i = 0; i < 10; ++i) - { - #pragma omp critical hint(omp_sync_hint_none) /* OK */ - a += i; - #pragma omp critical (HASH) hint(omp_sync_hint_none) /* OK */ - a += i; - #pragma omp critical (HASH2) hint(omp_sync_hint_uncontended) /* OK */ - a += i; - #pragma omp critical (HASH3) hint(omp_sync_hint_contended) /* OK */ - a += i; - #pragma omp critical (HASH4) hint(omp_sync_hint_speculative) /* OK */ - a += i; - #pragma omp critical (HASH5) hint(omp_sync_hint_nonspeculative) /* OK */ - a += i; - #pragma omp critical (HASH6) hint(omp_sync_hint_contended + omp_sync_hint_speculative) /* OK */ - a += i; - #pragma omp critical (HASH6) hint(omp_sync_hint_contended | omp_sync_hint_speculative) /* OK */ - a += i; - - /* Accepted but invalid: different hint for same name. */ - #pragma omp critical (HASH6) hint(omp_sync_hint_uncontended + omp_sync_hint_speculative) - a += i; - /* Accepted but invalid: Some random integer expr. */ - #pragma omp critical (HASH) hint(omp_sync_hint_speculative + 1 + 2) - a += i; - - #pragma omp critical (HASH) hint(-3) /* { dg-error "expected constant integer expression" } */ - a += i; - #pragma omp critical (HASH2) hint(b) /* { dg-error "constant integer expression" } */ - a += i; -/* - Fails with gcc as 'expected identifier' and - with g++ as "clause requires a name, except when 'omp_sync_hint_none'" - #pragma omp critical () hint(omp_sync_hint_speculative) - a += i; -*/ - #pragma omp critical hint(omp_sync_hint_speculative) /* { dg-error "with 'hint' clause requires a name, except when 'omp_sync_hint_none' is used" } */ - a += i; - } -} diff --git a/gcc/testsuite/c-c++-common/gomp/critical-hint-2.c b/gcc/testsuite/c-c++-common/gomp/critical-hint-2.c deleted file mode 100644 index effe24a..0000000 --- a/gcc/testsuite/c-c++-common/gomp/critical-hint-2.c +++ /dev/null @@ -1,36 +0,0 @@ -/* { dg-additional-options "-fdump-tree-original" } */ -#include <omp.h> - -void -example_criticial () -{ - int a, b; - #pragma omp parallel for - for (int i = 0; i < 10; ++i) - { - #pragma omp critical hint(omp_sync_hint_none) - a += i; - #pragma omp critical (HASH1) hint(omp_sync_hint_none) - a += i; - #pragma omp critical (HASH2) hint(omp_sync_hint_uncontended) - a += i; - #pragma omp critical (HASH3) hint(omp_sync_hint_contended) - a += i; - #pragma omp critical (HASH4) hint(omp_sync_hint_speculative) - a += i; - #pragma omp critical (HASH5) hint(omp_sync_hint_nonspeculative) - a += i; - #pragma omp critical (HASH6) hint(omp_sync_hint_contended + omp_sync_hint_speculative) - a += i; - #pragma omp critical (HASH7) hint(omp_sync_hint_contended | omp_sync_hint_speculative) - a += i; - } -} - -/* { dg-final { scan-tree-dump-times "omp critical \\(HASH1\\) hint\\(0\\)" 1 "original" } } */ -/* { dg-final { scan-tree-dump-times "omp critical \\(HASH2\\) hint\\(1\\)" 1 "original" } } */ -/* { dg-final { scan-tree-dump-times "omp critical \\(HASH3\\) hint\\(2\\)" 1 "original" } } */ -/* { dg-final { scan-tree-dump-times "omp critical \\(HASH4\\) hint\\(8\\)" 1 "original" } } */ -/* { dg-final { scan-tree-dump-times "omp critical \\(HASH5\\) hint\\(4\\)" 1 "original" } } */ -/* { dg-final { scan-tree-dump-times "omp critical \\(HASH6\\) hint\\(10\\)" 1 "original" } } */ -/* { dg-final { scan-tree-dump-times "omp critical \\(HASH7\\) hint\\(10\\)" 1 "original" } } */ diff --git a/gcc/testsuite/gfortran.dg/gomp/critical-hint-1.f90 b/gcc/testsuite/gfortran.dg/gomp/critical-hint-1.f90 deleted file mode 100644 index c26b617..0000000 --- a/gcc/testsuite/gfortran.dg/gomp/critical-hint-1.f90 +++ /dev/null @@ -1,94 +0,0 @@ -subroutine example_criticial () - use omp_lib - implicit none - integer, parameter :: my_omp_hint = omp_sync_hint_contended - integer i, a, b - - !$omp parallel do - do i = 1, 10 - !$omp critical (HASH0) hint(my_omp_hint) ! OK - a = a + i; - !$omp end critical (HASH0) - end do - !$omp parallel do - do i = 1, 10 - !$omp critical (HASH1) hint(omp_sync_hint_none) ! OK - a = a + i; - !$omp end critical (HASH1) - end do - !$omp parallel do - do i = 1, 10 - !$omp critical (HASH2) hint(omp_sync_hint_uncontended) ! OK - a = a + i; - !$omp end critical (HASH2) - end do - !$omp parallel do - do i = 1, 10 - !$omp critical (HASH3) hint(omp_sync_hint_contended) ! OK - a = a + i; - !$omp end critical (HASH3) - end do - !$omp parallel do - do i = 1, 10 - !$omp critical (HASH4) hint(omp_sync_hint_speculative) ! OK - a = a + i; - !$omp end critical (HASH4) - end do - !$omp parallel do - do i = 1, 10 - !$omp critical (HASH5) hint(omp_sync_hint_nonspeculative) ! OK - a = a + i; - !$omp end critical (HASH5) - end do - !$omp parallel do - do i = 1, 10 - !$omp critical (HASH6) hint(omp_sync_hint_contended + omp_sync_hint_speculative) ! OK - a = a + i; - !$omp end critical (HASH6) - end do - - !$omp parallel do - do i = 1, 10 - ! Accepted but invalid: different hint for same name. - !$omp critical (HASH6) hint(omp_sync_hint_contended + omp_sync_hint_speculative) ! OK - a = a + i; - !$omp end critical (HASH6) - end do - !$omp parallel do - do i = 1, 10 - ! Accepted but invalid: Some random integer expr. - !$omp critical (HASH) hint(1 + 2) - a = a + i; - !$omp end critical (HASH) - end do - !$omp parallel do - do i = 1, 10 - !$omp critical (HASH) hint(-3) ! { dg-error "shall be a valid constant hint expression" } - a = a + i; - !$omp end critical (HASH) - end do - !$omp parallel do - do i = 1, 10 - !$omp critical (HASH2) hint(b) ! { dg-error "shall be a valid constant hint expression" } - a = a + i; - !$omp end critical (HASH2) - end do - !$omp parallel do - do i = 1, 10 - !$omp critical () hint(omp_hint_speculative) ! { dg-error "Invalid character in name" } - a = a + i; -! !$omp end critical - end do - !$omp parallel do - do i = 1, 10 - !$omp critical hint(omp_sync_hint_none) ! OK - a = a + i; - !$omp end critical - end do - !$omp parallel do - do i = 1, 10 - !$omp critical hint(omp_sync_hint_contended) ! { dg-error "CRITICAL at .1. with HINT clause requires a NAME, except when omp_sync_hint_none is used" } - a = a + i; - !$omp end critical - end do -end diff --git a/gcc/testsuite/gfortran.dg/gomp/critical-hint-2.f90 b/gcc/testsuite/gfortran.dg/gomp/critical-hint-2.f90 deleted file mode 100644 index 15d6206..0000000 --- a/gcc/testsuite/gfortran.dg/gomp/critical-hint-2.f90 +++ /dev/null @@ -1,65 +0,0 @@ -! { dg-additional-options "-fdump-tree-original" } -subroutine example_criticial () - use omp_lib - implicit none - integer, parameter :: my_omp_hint = omp_sync_hint_contended - integer i, a, b - - !$omp parallel do - do i = 1, 10 - !$omp critical (HASH0) hint(my_omp_hint) - a = a + i; - !$omp end critical (HASH0) - end do - !$omp parallel do - do i = 1, 10 - !$omp critical (HASH1), hint(omp_sync_hint_none) - a = a + i; - !$omp end critical (HASH1) - end do - !$omp parallel do - do i = 1, 10 - !$omp critical (HASH2) hint(omp_sync_hint_uncontended) - a = a + i; - !$omp end critical (HASH2) - end do - !$omp parallel do - do i = 1, 10 - !$omp critical (HASH3) hint(omp_sync_hint_contended) - a = a + i; - !$omp end critical (HASH3) - end do - !$omp parallel do - do i = 1, 10 - !$omp critical (HASH4) hint(omp_sync_hint_speculative) - a = a + i; - !$omp end critical (HASH4) - end do - !$omp parallel do - do i = 1, 10 - !$omp critical (HASH5) hint(omp_sync_hint_nonspeculative) - a = a + i; - !$omp end critical (HASH5) - end do - !$omp parallel do - do i = 1, 10 - !$omp critical (HASH6), hint(omp_sync_hint_contended + omp_sync_hint_speculative) - a = a + i; - !$omp end critical (HASH6) - end do - !$omp parallel do - do i = 1, 10 - !$omp critical hint(omp_sync_hint_none + omp_sync_hint_none) - a = a + i; - !$omp end critical - end do -end - -! { dg-final { scan-tree-dump-times "omp critical \\(hash0\\) hint\\(2\\)" 1 "original" } } -! { dg-final { scan-tree-dump-times "omp critical \\(hash1\\) hint\\(0\\)" 1 "original" } } -! { dg-final { scan-tree-dump-times "omp critical \\(hash2\\) hint\\(1\\)" 1 "original" } } -! { dg-final { scan-tree-dump-times "omp critical \\(hash3\\) hint\\(2\\)" 1 "original" } } -! { dg-final { scan-tree-dump-times "omp critical \\(hash4\\) hint\\(8\\)" 1 "original" } } -! { dg-final { scan-tree-dump-times "omp critical \\(hash5\\) hint\\(4\\)" 1 "original" } } -! { dg-final { scan-tree-dump-times "omp critical \\(hash6\\) hint\\(10\\)" 1 "original" } } -! { dg-final { scan-tree-dump-times "omp critical hint\\(0\\)" 1 "original" } } |