c++: prvalue of array type [PR111286]
[official-gcc.git] / gcc / testsuite / c-c++-common / gomp / allocate-5.c
blob2ca4786264ff5e3bddf5fe0b751eee8ab237d603
1 typedef enum omp_allocator_handle_t
2 #if __cplusplus >= 201103L
3 : __UINTPTR_TYPE__
4 #endif
6 omp_null_allocator = 0,
7 omp_default_mem_alloc = 1,
8 omp_large_cap_mem_alloc = 2,
9 omp_const_mem_alloc = 3,
10 omp_high_bw_mem_alloc = 4,
11 omp_low_lat_mem_alloc = 5,
12 omp_cgroup_mem_alloc = 6,
13 omp_pteam_mem_alloc = 7,
14 omp_thread_mem_alloc = 8,
15 __omp_allocator_handle_t_max__ = __UINTPTR_MAX__
16 } omp_allocator_handle_t;
18 void
19 foo ()
21 omp_allocator_handle_t my_allocator = omp_default_mem_alloc;
22 int a, b;
23 static int c;
24 #pragma omp allocate (a) /* { dg-message "sorry, unimplemented: '#pragma omp allocate' not yet supported" "" { target c++ } } */
25 #pragma omp allocate (b) allocator(my_allocator) /* { dg-message "sorry, unimplemented: '#pragma omp allocate' not yet supported" "" { target c++ } } */
26 #pragma omp allocate(c) align(32)
27 /* { dg-message "'allocator' clause required for static variable 'c'" "" { target c } .-1 } */
28 /* { dg-message "sorry, unimplemented: '#pragma omp allocate' not yet supported" "" { target c++ } .-2 } */
31 void
32 bar ()
34 int a, a2, b;
35 omp_allocator_handle_t my_allocator;
36 #pragma omp allocate /* { dg-error "expected '\\(' before end of line" } */
37 /* { dg-message "sorry, unimplemented: '#pragma omp allocate' not yet supported" "" { target c++ } .-1 } */
38 #pragma omp allocate allocator(my_allocator) /* { dg-error "expected '\\(' before 'allocator'" } */
39 /* { dg-message "sorry, unimplemented: '#pragma omp allocate' not yet supported" "" { target c++ } .-1 } */
40 #pragma omp allocate(a) foo(my_allocator) /* { dg-error "expected 'allocator'" } */
41 /* { dg-error "expected end of line before '\\(' token" "" { target *-*-* } .-1 } */
42 /* { dg-message "sorry, unimplemented: '#pragma omp allocate' not yet supported" "" { target c++ } .-2 } */
43 #pragma omp allocate(a2) allocator(b) /* { dg-error "'allocator' clause allocator expression has type 'int' rather than 'omp_allocator_handle_t'" "todo: cp/semantics.c" { xfail c++ } } */
44 /* { dg-message "sorry, unimplemented: '#pragma omp allocate' not yet supported" "" { target c++ } .-1 } */
48 void
49 align_test ()
51 int i1,i2,i3,i4,i5,i6;
52 #pragma omp allocate(i1) allocator(omp_default_mem_alloc), align(32)
53 /* { dg-message "sorry, unimplemented: '#pragma omp allocate' not yet supported" "" { target c++ } .-1 } */
54 #pragma omp allocate(i2) align ( 32 ),allocator(omp_default_mem_alloc)
55 /* { dg-message "sorry, unimplemented: '#pragma omp allocate' not yet supported" "" { target c++ } .-1 } */
56 #pragma omp allocate(i3),allocator(omp_default_mem_alloc) align(32)
57 /* { dg-message "sorry, unimplemented: '#pragma omp allocate' not yet supported" "" { target c++ } .-1 } */
58 #pragma omp allocate(i4) align ( 32 ) allocator(omp_default_mem_alloc)
59 /* { dg-message "sorry, unimplemented: '#pragma omp allocate' not yet supported" "" { target c++ } .-1 } */
61 #pragma omp allocate(i5) allocator ( omp_high_bw_mem_alloc ), align ( 32 ) allocator(omp_default_mem_alloc)
62 /* { dg-error "too many 'allocator' clauses" "" { target *-*-* } .-1 } */
63 /* { dg-error "expected end of line before '\\)' token" "" { target *-*-* } .-2 } */
64 /* { dg-message "sorry, unimplemented: '#pragma omp allocate' not yet supported" "" { target c++ } .-3 } */
65 #pragma omp allocate(i6) align ( 32 ), align(32) allocator(omp_default_mem_alloc)
66 /* { dg-error "too many 'align' clauses" "" { target *-*-* } .-1 } */
67 /* { dg-error "expected end of line before '\\)' token" "" { target *-*-* } .-2 } */
68 /* { dg-message "sorry, unimplemented: '#pragma omp allocate' not yet supported" "" { target c++ } .-3 } */
71 void
72 align_test2 ()
74 int i, i2,i3;
75 #pragma omp allocate(i) align (32.0) /* { dg-error "'align' clause argument needs to be positive constant power of two integer expression" } */
76 /* { dg-message "sorry, unimplemented: '#pragma omp allocate' not yet supported" "" { target c++ } .-1 } */
77 #pragma omp allocate(i2) align ( 31 ) /* { dg-error "'align' clause argument needs to be positive constant power of two integer expression" } */
78 /* { dg-message "sorry, unimplemented: '#pragma omp allocate' not yet supported" "" { target c++ } .-1 } */
79 #pragma omp allocate(i3) align ( -32 ) /* { dg-error "'align' clause argument needs to be positive constant power of two integer expression" } */
80 /* { dg-message "sorry, unimplemented: '#pragma omp allocate' not yet supported" "" { target c++ } .-1 } */