aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/c-c++-common/gomp/allocate-17.c
blob: f75af0c2d93ac8cf7e848b1e4c276b601ecc9253 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/* This file has a syntax error but should not ICE.
   Namely, a '}' is missing in one(). */

typedef enum omp_allocator_handle_t
#if __cplusplus >= 201103L
: __UINTPTR_TYPE__
#endif
{
  omp_default_mem_alloc = 1,
  omp_low_lat_mem_alloc = 5,
  __omp_allocator_handle_t_max__ = __UINTPTR_MAX__
} omp_allocator_handle_t;

#include <stdint.h>

void
one ()
{  /* { dg-note "to match this '\{'" "" { target c++ } } */
  int result = 0, n = 3;
  #pragma omp target map(tofrom: result) firstprivate(n)
    {
      int var = 5; //, var2[n];
      #pragma omp allocate(var) align(128) allocator(omp_low_lat_mem_alloc) /* { dg-message "sorry, unimplemented: '#pragma omp allocate' not yet supported" "" { target c++ } } */
       var = 7;
}

void
two ()
{ /* { dg-error "a function-definition is not allowed here before '\{' token" "" { target c++ } } */
  int scalar = 44;
  #pragma omp allocate(scalar)

  #pragma omp parallel firstprivate(scalar)
    scalar = 33;
}
/* { dg-error "expected declaration or statement at end of input" "" { target c } .-1 } */
/* { dg-error "expected '\}' at end of input" "" { target c++ } .-2 } */