(root)/
gcc-13.2.0/
gcc/
testsuite/
c-c++-common/
gomp/
allocate-5.c
       1  typedef enum omp_allocator_handle_t
       2  #if __cplusplus >= 201103L
       3  : __UINTPTR_TYPE__
       4  #endif
       5  {
       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;
      17  
      18  void
      19  foo ()
      20  {
      21    int a, b;
      22    omp_allocator_handle_t my_allocator;
      23  #pragma omp allocate (a)  /* { dg-message "sorry, unimplemented: '#pragma omp allocate' not yet supported" } */
      24  #pragma omp allocate (b) allocator(my_allocator)  /* { dg-message "sorry, unimplemented: '#pragma omp allocate' not yet supported" } */
      25  }
      26  
      27  void
      28  bar ()
      29  {
      30    int a, b;
      31    omp_allocator_handle_t my_allocator;
      32  #pragma omp allocate  /* { dg-error "expected '\\(' before end of line" } */
      33    /* { dg-message "sorry, unimplemented: '#pragma omp allocate' not yet supported" "" { target *-*-* } .-1 } */
      34  #pragma omp allocate allocator(my_allocator)  /* { dg-error "expected '\\(' before 'allocator'" } */
      35    /* { dg-message "sorry, unimplemented: '#pragma omp allocate' not yet supported" "" { target *-*-* } .-1 } */
      36  #pragma omp allocate(a) foo(my_allocator) /* { dg-error "expected 'allocator'" } */
      37    /* { dg-error "expected end of line before '\\(' token" "" { target *-*-* } .-1 } */
      38    /* { dg-message "sorry, unimplemented: '#pragma omp allocate' not yet supported" "" { target *-*-* } .-2 } */
      39  #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++ } } */
      40    /* { dg-message "sorry, unimplemented: '#pragma omp allocate' not yet supported" "" { target *-*-* } .-1 } */
      41  }
      42  
      43  
      44  void
      45  align_test ()
      46  {
      47    int i;
      48    #pragma omp allocate(i) allocator(omp_default_mem_alloc), align(32)
      49    /* { dg-message "sorry, unimplemented: '#pragma omp allocate' not yet supported" "" { target *-*-* } .-1 } */
      50    #pragma omp allocate(i) align ( 32 ),allocator(omp_default_mem_alloc)
      51    /* { dg-message "sorry, unimplemented: '#pragma omp allocate' not yet supported" "" { target *-*-* } .-1 } */
      52    #pragma omp allocate(i),allocator(omp_default_mem_alloc) align(32)
      53    /* { dg-message "sorry, unimplemented: '#pragma omp allocate' not yet supported" "" { target *-*-* } .-1 } */
      54    #pragma omp allocate(i) align ( 32 ) allocator(omp_default_mem_alloc)
      55    /* { dg-message "sorry, unimplemented: '#pragma omp allocate' not yet supported" "" { target *-*-* } .-1 } */
      56  
      57    #pragma omp allocate(i) allocator ( omp_high_bw_mem_alloc ), align ( 32 ) allocator(omp_default_mem_alloc)
      58    /* { dg-error "too many 'allocator' clauses" "" { target *-*-* } .-1 } */
      59    /* { dg-error "expected end of line before '\\)' token" "" { target *-*-* } .-2 } */
      60    /* { dg-message "sorry, unimplemented: '#pragma omp allocate' not yet supported" "" { target *-*-* } .-3 } */
      61    #pragma omp allocate(i) align ( 32 ), align(32) allocator(omp_default_mem_alloc)
      62    /* { dg-error "too many 'align' 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 *-*-* } .-3 } */
      65  }
      66  
      67  void
      68  align_test2 ()
      69  {
      70    int i;
      71    #pragma omp allocate(i) align (32.0)  /* { dg-error "'align' clause argument needs to be positive constant power of two integer expression" } */
      72    /* { dg-message "sorry, unimplemented: '#pragma omp allocate' not yet supported" "" { target *-*-* } .-1 } */
      73    #pragma omp allocate(i) align ( 31 )  /* { dg-error "'align' clause argument needs to be positive constant power of two integer expression" } */
      74    /* { dg-message "sorry, unimplemented: '#pragma omp allocate' not yet supported" "" { target *-*-* } .-1 } */
      75    #pragma omp allocate(i) align ( -32 )  /* { 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 *-*-* } .-1 } */
      77  }