diff options
author | Tobias Burnus <tobias@codesourcery.com> | 2023-02-09 11:40:29 +0100 |
---|---|---|
committer | Tobias Burnus <tobias@codesourcery.com> | 2023-02-09 11:42:21 +0100 |
commit | 1eb78a935aa90edb21f3102b310b661e36488abe (patch) | |
tree | 2d0be675cb35393eaeea9f1e769c15fff7d9bf79 /gcc/testsuite/c-c++-common | |
parent | ae091a44f6a477fbcf463e80fd604540cad3b37f (diff) | |
download | gcc-1eb78a935aa90edb21f3102b310b661e36488abe.zip gcc-1eb78a935aa90edb21f3102b310b661e36488abe.tar.gz gcc-1eb78a935aa90edb21f3102b310b661e36488abe.tar.bz2 |
OpenMP: Parse align clause in allocate directive in C/C++
gcc/c/ChangeLog:
* c-parser.cc (c_parser_omp_allocate): Parse align
clause and check for restrictions.
gcc/cp/ChangeLog:
* parser.cc (cp_parser_omp_allocate): Parse align
clause and check for restrictions.
gcc/testsuite/ChangeLog:
* c-c++-common/gomp/allocate-5.c: Extend for align clause.
Diffstat (limited to 'gcc/testsuite/c-c++-common')
-rw-r--r-- | gcc/testsuite/c-c++-common/gomp/allocate-5.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/gcc/testsuite/c-c++-common/gomp/allocate-5.c b/gcc/testsuite/c-c++-common/gomp/allocate-5.c index 34dcb48..8a91812 100644 --- a/gcc/testsuite/c-c++-common/gomp/allocate-5.c +++ b/gcc/testsuite/c-c++-common/gomp/allocate-5.c @@ -39,3 +39,39 @@ bar () #pragma omp allocate(a) allocator(b) /* { dg-error "'allocator' clause allocator expression has type 'int' rather than 'omp_allocator_handle_t'" "todo: cp/semantics.c" { xfail c++ } } */ /* { dg-message "sorry, unimplemented: '#pragma omp allocate' not yet supported" "" { target *-*-* } .-1 } */ } + + +void +align_test () +{ + int i; + #pragma omp allocate(i) allocator(omp_default_mem_alloc), align(32) + /* { dg-message "sorry, unimplemented: '#pragma omp allocate' not yet supported" "" { target *-*-* } .-1 } */ + #pragma omp allocate(i) align ( 32 ),allocator(omp_default_mem_alloc) + /* { dg-message "sorry, unimplemented: '#pragma omp allocate' not yet supported" "" { target *-*-* } .-1 } */ + #pragma omp allocate(i),allocator(omp_default_mem_alloc) align(32) + /* { dg-message "sorry, unimplemented: '#pragma omp allocate' not yet supported" "" { target *-*-* } .-1 } */ + #pragma omp allocate(i) align ( 32 ) allocator(omp_default_mem_alloc) + /* { dg-message "sorry, unimplemented: '#pragma omp allocate' not yet supported" "" { target *-*-* } .-1 } */ + + #pragma omp allocate(i) allocator ( omp_high_bw_mem_alloc ), align ( 32 ) allocator(omp_default_mem_alloc) + /* { dg-error "too many 'allocator' clauses" "" { target *-*-* } .-1 } */ + /* { dg-error "expected end of line before '\\)' token" "" { target *-*-* } .-2 } */ + /* { dg-message "sorry, unimplemented: '#pragma omp allocate' not yet supported" "" { target *-*-* } .-3 } */ + #pragma omp allocate(i) align ( 32 ), align(32) allocator(omp_default_mem_alloc) + /* { dg-error "too many 'align' clauses" "" { target *-*-* } .-1 } */ + /* { dg-error "expected end of line before '\\)' token" "" { target *-*-* } .-2 } */ + /* { dg-message "sorry, unimplemented: '#pragma omp allocate' not yet supported" "" { target *-*-* } .-3 } */ +} + +void +align_test2 () +{ + int i; + #pragma omp allocate(i) align (32.0) /* { dg-error "'align' clause argument needs to be positive constant power of two integer expression" } */ + /* { dg-message "sorry, unimplemented: '#pragma omp allocate' not yet supported" "" { target *-*-* } .-1 } */ + #pragma omp allocate(i) align ( 31 ) /* { dg-error "'align' clause argument needs to be positive constant power of two integer expression" } */ + /* { dg-message "sorry, unimplemented: '#pragma omp allocate' not yet supported" "" { target *-*-* } .-1 } */ + #pragma omp allocate(i) align ( -32 ) /* { dg-error "'align' clause argument needs to be positive constant power of two integer expression" } */ + /* { dg-message "sorry, unimplemented: '#pragma omp allocate' not yet supported" "" { target *-*-* } .-1 } */ +} |