code = MULT_EXPR;
break;
case CPP_MINUS:
+ warning_at (c_parser_peek_token (parser)->location,
+ OPT_Wdeprecated_openmp,
+ "%<-%> operator for reductions deprecated in OpenMP 5.2");
code = MINUS_EXPR;
break;
case CPP_AND:
kind = OMP_CLAUSE_LINEAR_DEFAULT;
if (kind != OMP_CLAUSE_LINEAR_DEFAULT)
{
+ warning_at (clause_loc, OPT_Wdeprecated_openmp,
+ "specifying the list items as arguments to the modifiers is "
+ "deprecated since OpenMP 5.2");
old_linear_modifier = true;
c_parser_consume_token (parser);
c_parser_consume_token (parser);
else if (strcmp ("depobj", p) == 0)
kind = OMP_CLAUSE_DEPEND_DEPOBJ;
else if (strcmp ("sink", p) == 0)
- dkind = OMP_CLAUSE_DOACROSS_SINK;
+ {
+ warning_at (clause_loc, OPT_Wdeprecated_openmp,
+ "%<sink%> modifier with %<depend%> clause deprecated since "
+ "OpenMP 5.2, use with %<doacross%>");
+ dkind = OMP_CLAUSE_DOACROSS_SINK;
+ }
else if (strcmp ("source", p) == 0)
- dkind = OMP_CLAUSE_DOACROSS_SOURCE;
+ {
+ warning_at (clause_loc, OPT_Wdeprecated_openmp,
+ "%<source%> modifier with %<depend%> clause deprecated since "
+ "OpenMP 5.2, use with %<doacross%>");
+ dkind = OMP_CLAUSE_DOACROSS_SOURCE;
+ }
else
goto invalid_kind;
break;
int close_modifier = 0;
int present_modifier = 0;
int mapper_modifier = 0;
+ int num_commas = 0;
+ int num_identifiers = 0;
tree mapper_name = NULL_TREE;
tree iterators = NULL_TREE;
for (int pos = 1; pos < map_kind_pos; ++pos)
if (tok->type == CPP_COMMA)
{
+ ++num_commas;
+ if (num_commas > num_identifiers)
+ c_parser_error (parser, "illegal comma");
c_parser_consume_token (parser);
continue;
}
parens.skip_until_found_close (parser);
return list;
}
+ ++num_identifiers;
+ if (num_identifiers - 1 != num_commas)
+ warning_at (clause_loc, OPT_Wdeprecated_openmp,
+ "%<map%> clause modifiers without comma separation is deprecated "
+ "since OpenMP 5.2");
}
if (c_parser_next_token_is (parser, CPP_NAME)
}
else
{
+ warning_at (c_parser_peek_token (parser)->location,
+ OPT_Wdeprecated_openmp,
+ "use of %<omp declare target%> as a synonym for %<omp begin declare "
+ "target%> has been deprecated since OpenMP 5.2");
bool attr_syntax = parser->in_omp_attribute_pragma != NULL;
c_parser_skip_to_pragma_eol (parser);
c_omp_declare_target_attr attr = { attr_syntax, -1, 0 };
}
for (tree c = clauses; c; c = OMP_CLAUSE_CHAIN (c))
{
+ if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_ENTER && OMP_CLAUSE_ENTER_TO (c))
+ warning_at (c_parser_peek_token (parser)->location,
+ OPT_Wdeprecated_openmp, "%<to%> clause with %<declare target%> "
+ "deprecated since OpenMP 5.2, use %<enter%>");
if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_DEVICE_TYPE)
device_type |= OMP_CLAUSE_DEVICE_TYPE_KIND (c);
if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_INDIRECT)
location_t match_loc = c_parser_peek_token (parser)->location;
const char *p = IDENTIFIER_POINTER (c_parser_peek_token (parser)->value);
+ if (strcmp (p, "default") == 0)
+ warning_at (pragma_loc, OPT_Wdeprecated_openmp,
+ "%<default%> clause on metadirectives deprecated since "
+ "OpenMP 5.2, use %<otherwise%>");
c_parser_consume_token (parser);
bool default_p
= strcmp (p, "default") == 0 || strcmp (p, "otherwise") == 0;
{
case CPP_PLUS: code = PLUS_EXPR; break;
case CPP_MULT: code = MULT_EXPR; break;
- case CPP_MINUS: code = MINUS_EXPR; break;
+ case CPP_MINUS:
+ warning_at (cp_lexer_peek_token (parser->lexer)->location,
+ OPT_Wdeprecated_openmp,
+ "%<-%> operator for reductions deprecated in OpenMP 5.2");
+ code = MINUS_EXPR;
+ break;
case CPP_AND: code = BIT_AND_EXPR; break;
case CPP_XOR: code = BIT_XOR_EXPR; break;
case CPP_OR: code = BIT_IOR_EXPR; break;
{
cp_lexer_consume_token (parser->lexer);
old_linear_modifier = true;
+ warning_at (cp_lexer_peek_token (parser->lexer)->location,
+ OPT_Wdeprecated_openmp,
+ "specifying the list items as arguments to the modifiers is "
+ "deprecated since OpenMP 5.2");
}
else
kind = OMP_CLAUSE_LINEAR_DEFAULT;
else if (strcmp ("depobj", p) == 0)
kind = OMP_CLAUSE_DEPEND_DEPOBJ;
else if (strcmp ("sink", p) == 0)
- dkind = OMP_CLAUSE_DOACROSS_SINK;
+ {
+ warning_at (loc, OPT_Wdeprecated_openmp,
+ "%<sink%> modifier with %<depend%> clause deprecated since "
+ "OpenMP 5.2, use with %<doacross%>");
+ dkind = OMP_CLAUSE_DOACROSS_SINK;
+ }
else if (strcmp ("source", p) == 0)
- dkind = OMP_CLAUSE_DOACROSS_SOURCE;
+ {
+ warning_at (loc, OPT_Wdeprecated_openmp,
+ "%<source%> modifier with %<depend%> clause deprecated since "
+ "OpenMP 5.2, use with %<doacross%>");
+ dkind = OMP_CLAUSE_DOACROSS_SOURCE;
+ }
else
goto invalid_kind;
break;
static tree
cp_parser_omp_clause_map (cp_parser *parser, tree list, bool declare_mapper_p)
{
+ location_t clause_loc = cp_lexer_peek_token (parser->lexer)->location;
tree nlist, c;
enum gomp_map_kind kind = declare_mapper_p ? GOMP_MAP_UNSET : GOMP_MAP_TOFROM;
bool close_modifier = false;
bool present_modifier = false;
bool mapper_modifier = false;
+ int num_commas = 0;
+ int num_identifiers = 0;
tree mapper_name = NULL_TREE;
tree iterators = NULL_TREE;
for (int pos = 1; pos < map_kind_pos; ++pos)
cp_token *tok = cp_lexer_peek_token (parser->lexer);
if (tok->type == CPP_COMMA)
{
+ ++num_commas;
+ if (num_commas > num_identifiers)
+ cp_parser_error (parser, "illegal comma");
cp_lexer_consume_token (parser->lexer);
continue;
}
/*consume_paren=*/true);
return list;
}
+ ++num_identifiers;
+ if (num_identifiers - 1 != num_commas)
+ warning_at (clause_loc, OPT_Wdeprecated_openmp,
+ "%<map%> clause modifiers without comma separation is "
+ "deprecated since OpenMP 5.2");
}
if (cp_lexer_next_token_is (parser->lexer, CPP_NAME)
}
else
{
+ warning_at (cp_lexer_peek_token (parser->lexer)->location,
+ OPT_Wdeprecated_openmp,
+ "use of %<omp declare target%> as a synonym for %<omp begin declare "
+ "target%> has been deprecated since OpenMP 5.2");
cp_omp_declare_target_attr a
= { parser->lexer->in_omp_attribute_pragma, -1, false };
vec_safe_push (scope_chain->omp_declare_target_attribute, a);
}
for (tree c = clauses; c; c = OMP_CLAUSE_CHAIN (c))
{
+ if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_ENTER && OMP_CLAUSE_ENTER_TO (c))
+ warning_at (OMP_CLAUSE_LOCATION (c), OPT_Wdeprecated_openmp,
+ "%<to%> clause with %<declare target%> deprecated since "
+ "OpenMP 5.2, use %<enter%>");
if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_DEVICE_TYPE)
device_type |= OMP_CLAUSE_DEVICE_TYPE_KIND (c);
if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_INDIRECT)
location_t match_loc = cp_lexer_peek_token (parser->lexer)->location;
const char *p
= IDENTIFIER_POINTER (cp_lexer_peek_token (parser->lexer)->u.value);
+ if (strcmp (p, "default") == 0)
+ warning_at (match_loc, OPT_Wdeprecated_openmp,
+ "%<default%> clause on metadirectives deprecated since "
+ "OpenMP 5.2, use %<otherwise%>");
cp_lexer_consume_token (parser->lexer);
bool default_p
= strcmp (p, "default") == 0 || strcmp (p, "otherwise") == 0;
--- /dev/null
+// tests for deprecation of 'to' clause with 'declare target' and the '-'
+// operator when used in reductions.
+// { dg-warning "'to' clause with 'declare target' deprecated since OpenMP 5.2, use 'enter' \\\[-Wdeprecated-openmp\\\]" "" { target c } 12 }
+// { dg-warning "'to' clause with 'declare target' deprecated since OpenMP 5.2, use 'enter' \\\[-Wdeprecated-openmp\\\]" "" { target c } 18 }
+// { dg-warning "'to' clause with 'declare target' deprecated since OpenMP 5.2, use 'enter' \\\[-Wdeprecated-openmp\\\]" "" { target c++ } 10 }
+// { dg-warning "'to' clause with 'declare target' deprecated since OpenMP 5.2, use 'enter' \\\[-Wdeprecated-openmp\\\]" "" { target c++ } 16 }
+
+int x = 24;
+
+#pragma omp declare target to(x)
+
+int foo(int x)
+{
+ return x + 1;
+}
+#pragma omp declare target to(foo)
+
+int
+main()
+{
+ int y;
+ int result = 0;
+
+ #pragma omp target map(from:y)
+ y = foo(x);
+
+ #pragma omp parallel for reduction(-: result) // { dg-warning "'-' operator for reductions deprecated in OpenMP 5.2 \\\[-Wdeprecated-openmp\\\]" }
+ for (int i = 0; i < 8; ++i)
+ result -= i;
+
+ return 0;
+}
/* PR c/70436 */
-/* { dg-additional-options "-Wparentheses" } */
+/* { dg-additional-options "-Wparentheses -Wno-deprecated-openmp" } */
int a, b, c;
void bar (void);
/* { dg-do compile { target { c || c++11 } } } */
/* { dg-options "-fopenmp -std=c23" { target { c } } } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
#define N 100
void
otherwise (teams loop)
when (device={arch("nvptx")}: parallel loop))]] /* { dg-error "'otherwise' or 'default' clause must appear last" } */
for (i = 0; i < N; i++) c[i] = a[i] * b[i];
-
+
[[omp::directive (metadirective
when (device={arch("nvptx")} parallel loop) /* { dg-error "expected ':' before 'parallel'" } */
default (teams loop))]]
/* { dg-do compile { target { c || c++11 } } } */
/* { dg-options "-fopenmp -std=c23" { target { c } } } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
#define N 100
int
/* { dg-do compile { target { c || c++11 } } } */
/* { dg-options "-fopenmp -std=c23" { target { c } } } */
/* { dg-additional-options "-fdump-tree-gimple" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
#define N 100
void
{
int i;
- [[omp::sequence (directive (target map(to: x, y) map(from: z)), /* { dg-bogus "'target' construct with nested 'teams' construct contains directives outside of the 'teams' construct" "PR118694" { xfail offload_nvptx } } */
+ [[omp::sequence (directive (target map(to: x, y) map(from: z)), /* { dg-bogus "'target' construct with nested 'teams' construct contains directives outside of the 'teams' construct" "PR118694" { xfail offload_nvptx } } */
directive (metadirective
when (device={arch("nvptx")}: teams loop)
default (parallel loop)))]]
/* { dg-options "-fopenmp -std=c23" { target { c } } } */
/* { dg-additional-options "-fdump-tree-original" } */
/* { dg-additional-options "-fdump-tree-gimple" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
#define N 100
#pragma omp declare target
/* { dg-do compile { target { c || c++11 } } } */
/* { dg-options "-fopenmp -std=c23" { target { c } } } */
/* { dg-additional-options "-fdump-tree-original" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
#define N 100
void
/* { dg-do compile { target { c || c++11 } } } */
/* { dg-options "-fopenmp -std=c23" { target { c } } } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
#define N 256
void
/* { dg-do compile } */
/* { dg-options "-fopenmp" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
extern int a;
#pragma omp begin declare target device_type (host)
int b;
/* { dg-do compile } */
/* { dg-options "-fopenmp" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
extern int a;
#pragma omp begin declare target
#pragma omp declare target to (a)
+// { dg-additional-options "-Wno-deprecated-openmp" }
struct T { int a; int *b; };
struct S { int *s; char u; struct T v; long x; };
/* { dg-do compile } */
/* { dg-options "-fopenmp" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
int foo (void), bar (void);
extern int a;
int b;
/* { dg-do compile } */
/* { dg-options "-fopenmp" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
extern int a;
#pragma omp declare target
#pragma omp declare target to (a)
/* { dg-do compile } */
/* { dg-options "-fopenmp" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
#pragma omp declare target
int a[] = { 1, 2, 3 };
extern int b[]; /* { dg-error "'b' in declare target directive does not have mappable type" } */
/* { dg-do compile } */
/* { dg-options "-fopenmp" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
void f1 (void) {}
void f2 (void);
#pragma omp declare target to (f1) device_type (any) to (f2)
+// { dg-additional-options "-Wno-deprecated-openmp" }
#pragma omp declare target
void foo (void); /* { dg-error "'#pragma omp declare target' without corresponding '#pragma omp end declare target'" } */
/* { dg-do compile } */
/* { dg-options "-fopenmp" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
#pragma omp declare target device_type (any) /* { dg-error "directive with only 'device_type' or 'indirect' clauses" } */
void f1 (void) {}
/* { dg-do compile } */
/* { dg-options "-fopenmp" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
extern int a, b;
#define X 1
#define Y 0
/* { dg-do compile } */
/* { dg-options "-fopenmp -fdump-tree-gimple" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
#pragma omp begin declare target indirect
void fn1 (void) { }
#pragma omp end declare target
/* { dg-do compile } */
/* { dg-additional-options "-foffload=disable -fdump-tree-gimple" } */
/* { dg-additional-options "-mavx512bw" { target { i?86-*-* x86_64-*-* } } } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
#undef i386
void f01 (void);
#pragma omp declare variant (f01) match (device={isa(avx512f,avx512bw)})
/* { dg-do compile } */
/* { dg-additional-options "-fdump-tree-gimple" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
void f01 (void);
#pragma omp declare variant (f01) match (user={condition(6 == 7)},implementation={vendor(gnu)})
void f02 (void);
/* { dg-do compile } */
/* { dg-additional-options "-fdump-tree-gimple" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
struct S { int s; };
void foo (char *);
void bar (int, char *, struct S, int *);
/* { dg-do compile } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
struct S { int s; };
void foo (char *);
void bar (int, char *, struct S, int *);
+// { dg-additional-options "-Wno-deprecated-openmp" }
int a, b[64];
struct S { int c; } *d, *e;
struct T;
+// { dg-additional-options "-Wno-deprecated-openmp" }
typedef struct __attribute__((__aligned__ (sizeof (void *)))) omp_depend_t {
char __omp_depend_t__[2 * sizeof (void *)];
} omp_depend_t;
+// { dg-additional-options "-Wno-deprecated-openmp" }
int thr;
#pragma omp threadprivate, (thr) /* { dg-error "expected '\\\(' before ',' token" } */
/* { dg-error "expected end of line before ',' token" "" { target c++ } .-1 } */
+// { dg-additional-options "-Wno-deprecated-openmp" }
int s1, s2, s3, s4, s5, s6, s7, s8;
#pragma omp declare target (s1, s2, s3, s4, s5, s6, s7, s8)
/* { dg-do compile } */
/* { dg-options "-fopenmp" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
void
foo (void)
{
/* PR middle-end/87649 */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
void
foo (void)
{
/* { dg-do compile } */
/* { dg-options "-fopenmp" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
void
foo (void)
{
/* PR middle-end/98205 */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
void baz (int) __attribute__((noreturn));
void
/* PR middle-end/108685 */
/* { dg-do compile } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
void
foo (int a)
{
/* { dg-do compile } */
/* { dg-options "-fopenmp" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
int i;
#pragma omp declare simd linear (val (x) : 1) linear (y : 2)
/* { dg-do compile } */
/* { dg-options "-fopenmp" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
int i;
#pragma omp declare simd linear (x : val, step (1)) linear (y : step (2))
/* { dg-do compile } */
/* { dg-options "-fopenmp" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
int step (int);
int val;
#pragma omp declare simd linear (val (x) : step (1)) /* { dg-error "is neither constant nor a parameter" } */
+// { dg-additional-options "-Wno-deprecated-openmp" }
int bar (int);
int baz (int *);
/* See also corresponding OpenMP C++ variant: '../../g++.dg/gomp/map-1.C'. */
/* See also corresponding OpenACC variant: '../goacc/data-clause-1.c'. */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
extern int a[][10], a2[][10];
int b[10], c[10][2], d[10], e[10], f[10];
int b2[10], c2[10][2], d2[10], e2[10], f2[10];
+// { dg-additional-options "-Wno-deprecated-openmp" }
struct S { int i : 1; int j : 4; long long k : 25; };
void bar (struct S, int);
#pragma omp declare target to (bar)
/* { dg-do compile } */
/* { dg-additional-options "-fdump-tree-original" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
void
foo (void)
{
; /* { dg-error "'map' clause with map-type modifier other than 'always', 'close', 'iterator', 'mapper' or 'present' before 'a'" "" { target c } .-1 } */
- #pragma omp target map (close a) /* { dg-error "'close' undeclared" "" { target c } } */
- /* { dg-error "'close' was not declared in this scope" "" { target c++ } .-1 } */
+ #pragma omp target map (close a) /* { dg-error "'close' undeclared" "" { target c } } */
+ /* { dg-error "'close' was not declared in this scope" "" { target c++ } .-1 } */
/* { dg-error "expected '\\)' before 'a'" "" { target *-*-* } .-2 } */
;
#pragma omp target map (always a) /* { dg-error "'always' undeclared" "" { target c } } */
- /* { dg-error "'always' was not declared in this scope" "" { target c++ } .-1 } */
+ /* { dg-error "'always' was not declared in this scope" "" { target c++ } .-1 } */
/* { dg-error "expected '\\)' before 'a'" "" { target *-*-* } .-2 } */
;
#pragma omp target exit data map(present,always,close,delete: a) map(close,present,always,release:b) map(always close present,from:b1)
int close = 0;
- #pragma omp target map (close)
+ #pragma omp target map (close)
;
- #pragma omp target map (close a) /* { dg-error "expected '\\)' before 'a'" } */
+ #pragma omp target map (close a) /* { dg-error "expected '\\)' before 'a'" } */
;
int always = 0;
/* { dg-do compile } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
#define N 100
void
otherwise (teams loop) \
when (device={arch("nvptx")}: parallel loop) /* { dg-error "'otherwise' or 'default' clause must appear last" } */
for (i = 0; i < N; i++) c[i] = a[i] * b[i];
-
+
#pragma omp metadirective \
when (device={arch("nvptx")} parallel loop) /* { dg-error "expected ':' before 'parallel'" } */ \
default (teams loop)
/* { dg-do compile } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
#define N 100
int
/* { dg-do compile } */
-/* { dg-additional-options "-fdump-tree-gimple" } */
+/* { dg-additional-options "-fdump-tree-gimple -Wno-deprecated-openmp" } */
#define N 100
{
int i;
- #pragma omp target map(to: x, y) map(from: z) /* { dg-bogus "'target' construct with nested 'teams' construct contains directives outside of the 'teams' construct" "PR118694" { xfail offload_nvptx } } */
+ #pragma omp target map(to: x, y) map(from: z) /* { dg-bogus "'target' construct with nested 'teams' construct contains directives outside of the 'teams' construct" "PR118694" { xfail offload_nvptx } } */
#pragma omp metadirective \
when (device={arch("nvptx")}: teams loop) \
default (parallel loop)
/* { dg-do compile } */
/* { dg-additional-options "-fdump-tree-original" } */
/* { dg-additional-options "-fdump-tree-gimple" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
#define N 100
#pragma omp declare target
/* { dg-do compile } */
/* { dg-additional-options "-fdump-tree-original" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
#define N 100
void
/* { dg-do compile } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
#define N 256
void
/* { dg-do compile } */
/* { dg-additional-options "-foffload=disable -fdump-tree-optimized" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
#include <stdlib.h>
static void
check (n, a, s);
}
-/* Check various combinations for enforcing correct ordering of
+/* Check various combinations for enforcing correct ordering of
construct matches. */
static void
f1 (int n, double* a, double s)
{
#pragma omp target teams
-#pragma omp parallel
+#pragma omp parallel
#pragma omp metadirective \
when (construct={target} \
: for) \
/* { dg-do compile } */
/* { dg-additional-options "-foffload=disable -fdump-tree-optimized" } */
/* { dg-additional-options "-DDEVICE_ARCH=x86_64 -DDEVICE_ISA=sse -msse" { target { x86 && lp64 } } } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
#include <stdlib.h>
static void
a[i] = a[i] * s;
}
-/* Check arch. Either DEVICE_ARCH is defined by command-line option,
+/* Check arch. Either DEVICE_ARCH is defined by command-line option,
or we know it is not x86_64. */
#ifdef DEVICE_ARCH
static void
/* { dg-do compile } */
/* { dg-additional-options "-fdump-tree-optimized" } */
/* { dg-additional-options "-DDEVICE_ARCH=x86_64 -DDEVICE_ISA=mmx -mmmx" { target { x86 && lp64 } } } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
#include <stdlib.h>
static void
a[i] = a[i] * s;
}
-/* Check arch. Either DEVICE_ARCH is defined by command-line option,
+/* Check arch. Either DEVICE_ARCH is defined by command-line option,
or we know it is not x86_64. */
#ifdef DEVICE_ARCH
static void
/* { dg-do compile } */
/* { dg-additional-options "-fdump-tree-optimized" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
/* In configurations without offloading configured, we can resolve many
instances of the target_device context selector at gimplification time
instead of waiting until late resolution. */
-void
+// { dg-additional-options "-Wno-deprecated-openmp" }
+ void
f1 (int *a)
{
int i;
/* { dg-do compile } */
/* { dg-options "-fopenmp" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
void
foo (void)
{
/* { dg-do compile } */
/* { dg-options "-fopenmp" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
void
foo (void)
{
/* { dg-final { scan-tree-dump-not "firstprivate\\\(var\[123]\\\)" "gimple" } } */
/* { dg-final { scan-tree-dump-not ".omp_data_arr.\[0-9]*.var" "omplower" } } */
/* { dg-final { scan-tree-dump-not ".omp_data_i->var" "omplower" } } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
void
foo (void)
{
/* PR c/106836 */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
void
foo (void)
{
/* { dg-do compile } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
/* This test case checks that the inner metadirective is accepted as intervening
code since it resolves to 'omp nothing'. */
/* { dg-do compile } */
/* { dg-additional-options "-std=c99" { target c } } */
/* { dg-additional-options "-std=c++11" { target c++ } } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
void foo (const char *);
#pragma omp declare target to (foo)
/* { dg-do compile } */
/* { dg-additional-options "-std=gnu99" { target c } } */
/* { dg-additional-options "-std=gnu++11" { target c++ } } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
void foo (const char *, const char *);
#pragma omp declare target to (foo)
/* { dg-do compile } */
/* { dg-additional-options "-std=c99" { target c } } */
/* { dg-additional-options "-std=c++11" { target c++ } } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
void foo (const char *);
#pragma omp declare target to (foo)
+// { dg-additional-options "-Wno-deprecated-openmp" }
#pragma omp declare target
void f0 (void);
/* PR c++/91987 */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
int bar (void);
void baz (int *);
#pragma omp declare target to (baz)
/* { dg-final { scan-tree-dump-times "__attribute__\\(\\(omp declare target\\)\\)\[\n\r\]*int called_in_target1" 1 "omplower" } } */
/* { dg-final { scan-tree-dump-times "__attribute__\\(\\(omp declare target\\)\\)\[\n\r\]*int called_in_target2" 1 "omplower" } } */
/* { dg-final { scan-tree-dump-times "__attribute__\\(\\(omp declare target\\)\\)\[\n\r\]*void tg_fn" 1 "omplower" } } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
#pragma omp requires reverse_offload
extern int add_3 (int);
/* { dg-do compile } */
/* { dg-options "-fopenmp" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
void
foo (void)
{
/* { dg-do compile } */
/* { dg-options "-fopenmp -Wunknown-pragmas -Werror" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
extern void bark (void);
int i,j,k;
int array[555];
/* { dg-do compile } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
void bar (int *);
void
/* { dg-do compile } */
/* { dg-options "-fopenmp" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
/* Test that we can handle multiple undeclared sink variables
gracefully. */
/* { dg-do compile } */
/* { dg-options "-fopenmp -fdump-tree-omplower" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
/* Test that we adjust pointer offsets for sink variables
correctly. */
/* { dg-do compile } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
void bar (int);
void
/* { dg-do compile } */
/* { dg-additional-options "-fdump-tree-gimple" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
int v = 6;
void bar (int);
void bar2 (int, long *, long *);
// { dg-do compile { target c++11 } }
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
#pragma omp declare target
#pragma omp declare target
[[omp::directive (declare target)]];
// { dg-do compile { target c++11 } }
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
typedef struct __attribute__((__aligned__ (sizeof (void *)))) omp_depend_t {
char __omp_depend_t__[2 * sizeof (void *)];
} omp_depend_t;
// { dg-do compile { target c++11 } }
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
int n1 = 0, n2 = 42;
[[omp::sequence (directive (requires, atomic_default_mem_order (seq_cst)))]];
[[omp::directive (declare reduction (plus: int: omp_out += omp_in) initializer (omp_priv = 0))]];
// { dg-do compile }
// { dg-require-effective-target tls }
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
#define p parallel
extern void bar (void);
// { dg-do compile }
// { dg-options "-fopenmp -ffat-lto-objects" }
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
#pragma omp declare simd uniform(b) linear(c, d) linear(uval(e)) linear(ref(f))
int f1 (int a, int b, int c, int &d, int &e, int &f)
{
+// { dg-additional-options "-Wno-deprecated-openmp" }
#pragma omp declare simd linear(p:1) linear(q:-1) linear(s:-3)
int
f1 (int *p, int *q, short *s)
// PR c++/71257
// { dg-do compile }
// { dg-options "-fopenmp-simd" }
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
struct S { int a; };
#pragma omp declare simd linear(val(a):2)
int f1 (int &a);
// PR middle-end/78025
// { dg-do compile }
// { dg-additional-options "-O2" }
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
struct S { S (); ~S (); };
int bar1 (int, int, float &, S &, int *, int, int &, int &, int &, int &, int &);
// PR c++/100872
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
template <int N, typename T>
struct S {
#pragma omp declare simd aligned(a : N * 2) aligned(b) linear(ref(b): N)
// { dg-do compile }
// { dg-options "-fopenmp" }
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
#pragma omp declare target
void f1 (int);
void f1 (double);
// { dg-do compile }
// { dg-options "-fopenmp" }
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
#pragma omp declare target
template <typename T>
struct S { T a; };
// { dg-do compile }
// { dg-additional-options "-fdump-tree-gimple" }
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
// Test implicit marking of declare target to.
int foo () { return 1; }
// { dg-skip-if "c++98 does not support attributes" { c++98_only } }
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
[[omp::decl (declare target, indirect(1))]] // { dg-error "directive with only 'device_type' or 'indirect' clause" }
int f (void) { return 5; }
+// { dg-additional-options "-Wno-deprecated-openmp" }
int a, b[64];
struct S { int c; } *d, *e;
struct T;
+// { dg-additional-options "-Wno-deprecated-openmp" }
typedef struct __attribute__((__aligned__ (sizeof (void *)))) omp_depend_t {
char __omp_depend_t__[2 * sizeof (void *)];
} omp_depend_t;
// PR c++/100957
// { dg-do compile }
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
struct S {
S ()
{
// { dg-do compile }
// { dg-options "-fopenmp" }
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
int i;
#pragma omp declare simd linear (ref (x) : 1) linear (uval (y) : 2)
// { dg-do compile }
// { dg-options "-fopenmp" }
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
#pragma omp declare target
int i, j;
// { dg-do compile { target c++11 } }
// { dg-options "-fopenmp" }
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
int i;
#pragma omp declare simd linear (x : ref, step (1)) linear (y : step (2), uval)
/* { dg-do compile { target c++11 } } */
/* { dg-options "-fopenmp" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
constexpr int step (int x) { return x; }
constexpr int val = 1;
constexpr int ref = 2;
+// { dg-additional-options "-Wno-deprecated-openmp" }
/* Test 'map' clause diagnostics. */
/* See also corresponding OpenMP C/C++ variant: '../../c-c++-common/gomp/map-1.c'. */
--- /dev/null
+// can't manage to elicit the "illegal comma" but it seems that we're already getting errors for improper syntax.
+// otherwise, though, the deprecation works as intended.
+int
+main()
+ {
+ float B[8];
+ float C[8];
+ // this should be completely fine
+ #pragma omp target teams map(to: B[0:8], C[0:8])
+ {}
+ // this should give us a deprecation warning
+ #pragma omp target teams map(close always present to: B[0:8], C[0:8]) // { dg-warning "'map' clause modifiers without comma separation is deprecated since OpenMP 5.2 \\\[-Wdeprecated-openmp\\\]" }
+ {}
+ // this should be completely fine
+ #pragma omp target teams map(close, always, present, to: B[0:8], C[0:8])
+ {}
+
+ #pragma omp target teams map(close always,, present, to: B[0:8], C[0:8])
+ {}
+ // { dg-error "'close' was not declared in this scope" "" { target *-*-* } 18 }
+ // { dg-error "expected '\\)' before 'always'" "" { target *-*-* } 18 }
+ // { dg-error "expected primary-expression before ',' token" "" { target *-*-* } 18 }
+ // { dg-error "'present' was not declared in this scope" "" { target *-*-* } 18 }
+ // { dg-error "found ':' in nested-name-specifier, expected '::'" "" { target *-*-* } 18 }
+ // { dg-error "'to' has not been declared; did you mean 'auto'?" "" { target *-*-* } 18 }
+
+ #pragma omp target teams map(,close to: B[0:8], C[0:8])
+ {}
+ // { dg-error "expected primary-expression before ',' token" "" { target *-*-* } 27 }
+ // { dg-error "'close' was not declared in this scope" "" { target *-*-* } 27 }
+ // { dg-error "expected '\\)' before 'to'" "" { target *-*-* } 27 }
+
+ #pragma omp target teams map(close,,always to: B[0:8] C[0:8])
+ {}
+ // { dg-error "expected primary-expression before ',' token" "" { target *-*-* } 33 }
+ // { dg-error "'close' was not declared in this scope" "" { target *-*-* } 33 }
+ // { dg-error "'always' was not declared in this scope" "" { target *-*-* } 33 }
+ // { dg-error "expected '\\)' before 'to'" "" { target *-*-* } 33 }
+ return 0;
+ }
// PR c++/118876
// { dg-do compile }
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
#pragma omp declare target
struct A { ~A () {} } a[2];
#pragma omp end declare target
// PR c++/119370
// { dg-do compile }
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
#pragma omp declare target
struct S {
int s;
/* { dg-do compile } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
void bar (int, int, int);
template<typename T>
/* { dg-do compile } */
/* { dg-skip-if "requires hosted libstdc++ for iostream" { ! hostedlib } } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
/* Tests iterators are allowed in ordered loops and that we keep track
of the original iterator DECL for diagnostic purposes. */
/* { dg-do compile } */
/* { dg-options "-fopenmp -fdump-tree-gimple" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
/* Test that we adjust pointer offsets for sink variables
correctly. */
/* { dg-options "-fopenmp -O2" } */
/* { dg-additional-options "-fopenmp-target-simd-clone=any -fdump-ipa-simdclone-details -fdump-ipa-cgraph" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
/* Test that simd clones are generated for functions with "declare target". */
#pragma omp declare target
/* { dg-options "-fopenmp -O2" } */
/* { dg-additional-options "-fopenmp-target-simd-clone=any -fdump-ipa-simdclone-details" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
/* Test that simd clones are not generated for "declare target"
functions that throw. */
// { dg-do compile }
// { dg-additional-options "-fdump-tree-gimple" }
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
int v = 6;
void bar (int);
void bar2 (int, long *, long *);
// { dg-do compile }
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
struct S
{
int s;
/* { dg-do compile } */
/* { dg-options "-fopenmp -std=c23" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
#pragma omp declare target
#pragma omp declare target
[[omp::directive (declare target)]];
/* { dg-do compile } */
/* { dg-options "-fopenmp -std=c23" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
#include "../../g++.dg/gomp/attrs-5.C"
/* { dg-do compile } */
/* { dg-options "-fopenmp -std=c23" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
#include "../../g++.dg/gomp/attrs-9.C"
/* { dg-do compile } */
/* { dg-require-effective-target tls } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
#define p parallel
extern void bar (void);
+// { dg-additional-options "-Wno-deprecated-openmp" }
#pragma omp declare simd linear(p:1) linear(val(q):-1) linear(s:-3)
int
f1 (int *p, int *q, short *s)
/* { dg-do compile } */
/* { dg-options "-fopenmp" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
int i, j;
void
--- /dev/null
+// can't manage to elicit the "illegal comma" but it seems that we're already getting errors for improper syntax.
+// otherwise, though, the deprecation works as intended.
+int
+main()
+ {
+ float B[8];
+ float C[8];
+ // this should be completely fine
+ #pragma omp target teams map(to: B[0:8], C[0:8])
+ {}
+ // this should give us a deprecation warning
+ #pragma omp target teams map(close always present to: B[0:8], C[0:8]) // { dg-warning "'map' clause modifiers without comma separation is deprecated since OpenMP 5.2 \\\[-Wdeprecated-openmp\\\]" }
+ {}
+ // this should be completely fine
+ #pragma omp target teams map(close, always, present, to: B[0:8], C[0:8])
+ {}
+ // this should be raising illegal comma.
+ // { dg-error "'close' undeclared" "" { target *-*-* } 19 }
+ #pragma omp target teams map(close always,, present, to: B[0:8], C[0:8])
+ {}
+ // { dg-error "expected '\\)' before 'always'" "" { target *-*-* } 19 }
+
+
+ #pragma omp target teams map(,close to: B[0:8], C[0:8]) // { dg-error "expected expression before ',' token" }
+ {}
+ // { dg-error "'always' undeclared" "" { target *-*-* } 27 }
+ #pragma omp target teams map(close,,always to: B[0:8] C[0:8]) // { dg-error "expected expression before ',' token" }
+ {}
+ return 0;
+ }
+// { dg-additional-options "-Wno-deprecated-openmp" }
int main (void)
{
int x, y;
/* PR middle-end/104757 */
/* { dg-do compile } */
/* { dg-options "-O2 -fopenmp" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
#pragma omp declare target
void
foo (int x, int y, int *z)
/* { dg-do compile } */
/* { dg-options "-fopenmp -fdump-tree-omplower" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
/* Test depend(sink) clause folding. */
int i,j,k, N;
/* { dg-do compile } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
int i,j, N;
extern void bar();
/* { dg-do compile } */
/* { dg-options "-fopenmp -fdump-tree-omplower" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
/* Test that we fold sink offsets correctly while taking into account
pointer sizes. */
/* { dg-options "-fopenmp -O2" } */
/* { dg-additional-options "-fopenmp-target-simd-clone=any -fdump-ipa-simdclone-details -fdump-ipa-cgraph" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
/* Test that simd clones are generated for functions with "declare target". */
#pragma omp declare target
/* { dg-options "-fopenmp -O2" } */
/* { dg-additional-options "-fdump-ipa-simdclone-details" } */
-
-/* Test that host simd clones are not generated for functions with
+// { dg-additional-options "-Wno-deprecated-openmp" }
+/* Test that host simd clones are not generated for functions with
"declare target" by default at -O2. */
#pragma omp declare target
/* { dg-options "-fopenmp -O2" } */
/* { dg-additional-options "-fopenmp-target-simd-clone=any -fdump-ipa-simdclone-details" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
/* Test that host simd clones are not generated for functions with the nohost
"declare target" clause. */
/* { dg-options "-fopenmp -O2" } */
/* { dg-additional-options "-fopenmp-target-simd-clone=any -fdump-ipa-simdclone-details" } */
-
-/* Test that simd clones are not generated for functions with
+// { dg-additional-options "-Wno-deprecated-openmp" }
+/* Test that simd clones are not generated for functions with
"declare target" but that write memory in the body. */
extern int save;
/* { dg-options "-fopenmp -O2" } */
/* { dg-additional-options "-fopenmp-target-simd-clone=any -fdump-ipa-simdclone-details" } */
-/* Test that simd clones are not generated for functions with
+/* Test that simd clones are not generated for functions with
"declare target" but unsuitable arguments. */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
struct s {
int a;
int b;
};
-
+
#pragma omp declare target
__attribute__ ((__noinline__)) int addit (struct s x)
{
/* { dg-options "-fopenmp -O2" } */
/* { dg-additional-options "-fopenmp-target-simd-clone=any -fdump-ipa-simdclone-details" } */
-
-/* Test that simd clones are not generated for functions with
- "declare target" but that call possibly side-effecting functions
+// { dg-additional-options "-Wno-deprecated-openmp" }
+/* Test that simd clones are not generated for functions with
+ "declare target" but that call possibly side-effecting functions
in the body. */
extern int f (int);
/* { dg-options "-fopenmp -O2" } */
/* { dg-additional-options "-fopenmp-target-simd-clone=any -fdump-ipa-simdclone-details" } */
-
-/* Test that simd clones are not generated for functions with
+// { dg-additional-options "-Wno-deprecated-openmp" }
+/* Test that simd clones are not generated for functions with
"declare target" that have no callers in the same compilation unit. */
#pragma omp declare target
/* { dg-options "-fopenmp -O2" } */
/* { dg-additional-options "-fopenmp-target-simd-clone=any -fdump-ipa-simdclone-details" } */
-
-/* Test that simd clones are not generated for functions with
+// { dg-additional-options "-Wno-deprecated-openmp" }
+/* Test that simd clones are not generated for functions with
"declare target" but that read volatile memory in the body. */
extern volatile int save;
/* { dg-do compile } */
/* { dg-options "-O2 -fopenmp -fdump-tree-optimized" } */
+// { dg-additional-options "-Wno-deprecated-openmp" }
/* { dg-final { scan-tree-dump-times "__builtin_GOMP_loop_doacross_start \[^\n\r]*, (?:2147483648|-2147483648), 0, " 1 "optimized" } } */
/* { dg-final { scan-tree-dump-times "__builtin_GOMP_loop_end " 1 "optimized" } } */
/* { dg-final { scan-tree-dump-times "__builtin_GOMP_doacross_post " 1 "optimized" } } */
/* { dg-final { scan-tree-dump-times "__builtin_GOMP_loop_ull_static_next " 1 "optimized" } } */
/* { dg-final { scan-tree-dump-times "__builtin_GOMP_workshare_task_reduction_unregister \\(0\\)" 1 "optimized" } } */
/* { dg-final { scan-tree-dump-times "__builtin_GOMP_parallel " 1 "optimized" } } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
unsigned long long int j;
void bar (unsigned long long int *);
/* { dg-do compile } */
/* { dg-options "-O2 -fopenmp -fdump-tree-optimized" } */
+// { dg-additional-options "-Wno-deprecated-openmp" }
/* { dg-final { scan-tree-dump-times "__builtin_GOMP_loop_ull_doacross_start \[^\n\r]*, (?:2147483650|-2147483646), 1, " 1 "optimized" } } */
/* { dg-final { scan-tree-dump-times "__builtin_GOMP_loop_end " 1 "optimized" } } */
/* { dg-final { scan-tree-dump-times "__builtin_GOMP_doacross_ull_post " 1 "optimized" } } */
/* { dg-do compile } */
/* { dg-options "-O2 -fopenmp -fdump-tree-optimized" } */
+// { dg-additional-options "-Wno-deprecated-openmp" }
/* { dg-final { scan-tree-dump-times "__builtin_GOMP_loop_doacross_start \[^\n\r]*, (?:2147483651|-2147483645), 1, " 1 "optimized" } } */
/* { dg-final { scan-tree-dump-times "__builtin_GOMP_loop_end " 1 "optimized" } } */
/* { dg-final { scan-tree-dump-times "__builtin_GOMP_doacross_post " 1 "optimized" } } */
// { dg-do run }
// { dg-require-effective-target offload_device_shared_as }
-
+// { dg-additional-options "-Wno-deprecated-declarations" }
+// { dg-additional-options "-Wno-deprecated-openmp" }
#include <stdlib.h>
struct typeX
+// { dg-additional-options "-Wno-deprecated-openmp" }
#include <stdlib.h>
#include <omp.h>
// { dg-do run }
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
typedef __PTRDIFF_TYPE__ ptrdiff_t;
extern "C" void abort ();
// PR c++/86443
// { dg-do run }
// { dg-additional-options "-std=c++17" }
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
typedef __PTRDIFF_TYPE__ ptrdiff_t;
extern "C" void abort ();
// { dg-do run }
// { dg-additional-options "-std=c++17" }
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
typedef __PTRDIFF_TYPE__ ptrdiff_t;
extern "C" void abort ();
// { dg-additional-options -O0 }
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
#include "pr101544-1.C"
+// { dg-additional-options "-Wno-deprecated-openmp" }
// See also '../libgomp.oacc-c++/pr101544-1.C'.
#ifndef ALWAYS_INLINE
# define ALWAYS_INLINE
// { dg-additional-options -O0 }
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
#include "pr96835-1.C"
// See also '../libgomp.oacc-c++/pr96835-1.C'.
+// { dg-additional-options "-Wno-deprecated-openmp" }
#ifndef ALWAYS_INLINE
# define ALWAYS_INLINE
#endif
// { dg-final { only_for_offload_target amdgcn-amdhsa scan-offload-tree-dump "v1\\._x = 5;" "optimized" { target offload_target_amdgcn } } }
// { dg-final { only_for_offload_target nvptx-none scan-offload-tree-dump-not "omp_initial_device;" "optimized" { target offload_target_nvptx } } }
// { dg-final { only_for_offload_target nvptx-none scan-offload-tree-dump "v1\\._x = 5;" "optimized" { target offload_target_nvptx } } }
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
#include <cassert>
#include <omp.h>
// { dg-final { only_for_offload_target amdgcn-amdhsa scan-offload-tree-dump "v1\\._x = 5;" "optimized" { target offload_target_amdgcn } } }
// { dg-final { only_for_offload_target nvptx-none scan-offload-tree-dump-not "omp_initial_device;" "optimized" { target offload_target_nvptx } } }
// { dg-final { only_for_offload_target nvptx-none scan-offload-tree-dump "v1\\._x = 5;" "optimized" { target offload_target_nvptx } } }
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
#include <cassert>
// { dg-do run }
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
#include <cassert>
#pragma omp declare target
+// { dg-additional-options "-Wno-deprecated-openmp" }
extern "C" void abort (void);
int g;
/* { dg-additional-options -fdump-tree-optimized-raw-asmname }
{ dg-additional-options -foffload-options=-fdump-tree-optimized-raw-asmname } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
#include <omp.h>
#include <vector>
/* { dg-additional-options -fdump-tree-optimized-raw-asmname }
{ dg-additional-options -foffload-options=-fdump-tree-optimized-raw-asmname } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
#include <omp.h>
#include <vector>
/* { dg-require-effective-target omp_usm } */
+// { dg-additional-options "-Wno-deprecated-openmp" }
#pragma omp requires unified_shared_memory self_maps
#define MEM_SHARED
// { dg-do run }
// { dg-additional-options -DMEM_SHARED { target offload_device_shared_as } }
+// { dg-additional-options "-Wno-deprecated-openmp" }
#include <stdlib.h>
#include <time.h>
// { dg-do run }
// { dg-additional-options "-std=c++20" }
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
#include <cmath>
#include <numbers>
// { dg-do run }
// { dg-additional-options "-std=c++20" }
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
#include <cmath>
#include <complex>
#include <numbers>
/* { dg-require-effective-target omp_usm } */
+// { dg-additional-options "-Wno-deprecated-openmp" }
#pragma omp requires unified_shared_memory self_maps
#define MEM_SHARED
// { dg-do run }
// { dg-additional-options -DMEM_SHARED { target offload_device_shared_as } }
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
#include <stdlib.h>
#include <time.h>
#include <deque>
/* { dg-require-effective-target omp_usm } */
+// { dg-additional-options "-Wno-deprecated-openmp" }
#pragma omp requires unified_shared_memory self_maps
#define MEM_SHARED
// { dg-do run }
// { dg-additional-options -DMEM_SHARED { target offload_device_shared_as } }
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
#include <stdlib.h>
#include <time.h>
#include <omp.h>
/* { dg-require-effective-target omp_usm } */
+// { dg-additional-options "-Wno-deprecated-openmp" }
#pragma omp requires unified_shared_memory self_maps
#define MEM_SHARED
// { dg-do run }
// { dg-additional-options -DMEM_SHARED { target offload_device_shared_as } }
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
#include <stdlib.h>
#include <time.h>
#include <omp.h>
// { dg-do run }
// { dg-additional-options "-std=c++20" }
+// { dg-additional-options "-Wno-deprecated-openmp" }
#include <cmath>
#include <numbers>
// { dg-additional-options "-std=c++20" }
/* { dg-require-effective-target omp_usm } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
#pragma omp requires unified_shared_memory self_maps
#define MEM_SHARED
// { dg-do run }
// { dg-additional-options "-std=c++20" }
// { dg-additional-options -DMEM_SHARED { target offload_device_shared_as } }
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
#include <stdlib.h>
#include <time.h>
#include <span>
// { dg-additional-options -std=c++20 }
// { dg-output-file target-std__valarray-1.output }
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
#include <valarray>
#include <ostream>
#include <sstream>
/* { dg-require-effective-target omp_usm } */
+// { dg-additional-options "-Wno-deprecated-openmp" }
#pragma omp requires unified_shared_memory self_maps
#define MEM_SHARED
// { dg-do run }
// { dg-additional-options -DMEM_SHARED { target offload_device_shared_as } }
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
#include <stdlib.h>
#include <time.h>
#include <valarray>
/* { dg-require-effective-target omp_usm } */
+// { dg-additional-options "-Wno-deprecated-openmp" }
#pragma omp requires unified_shared_memory self_maps
#define MEM_SHARED
// { dg-do run }
// { dg-additional-options -DMEM_SHARED { target offload_device_shared_as } }
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
#include <stdlib.h>
#include <time.h>
#include <vector>
/* PR c++/99509 */
-
-#pragma omp declare target
+#pragma omp declare target // { dg-warning "use of 'omp declare target' as a synonym for 'omp begin declare target' has been deprecated since OpenMP 5.2 \\\[-Wdeprecated-openmp\\\]" }
int data[] = {5};
#pragma omp end declare target
+// { dg-additional-options "-Wno-deprecated-openmp" }
#include <omp.h>
#include <stdlib.h>
#include <unistd.h>
{
int a[8], b[8], i;
omp_depend_t d1, d2;
- #pragma omp depobj (d1) depend(inout: omp_all_memory)
+ #pragma omp depobj (d1) depend(inout: omp_all_memory)
#pragma omp depobj (d2) depend(out: omp_all_memory)
for (i = 0; i < 8; i++)
{
b[0] = 6 * i + 57;
for (i = 1; i < 8; ++i)
{
- if (b[i] != 4 * i - 7)
+ if (b[i] != 4 * i - 7)
abort ();
b[i] = 6 * i + 57;
}
+// { dg-additional-options "-Wno-deprecated-openmp" }
#include <stdlib.h>
#include <omp.h>
/* { dg-additional-options "-std=gnu99" {target c } } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
#define CONDNE
#include "for-5.c"
/* { dg-additional-options "-std=gnu99" {target c } } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
#define CONDNE
#include "for-6.c"
+// { dg-additional-options "-Wno-deprecated-openmp" }
extern
#ifdef __cplusplus
"C"
/* { dg-additional-options "-std=gnu99" { target c } } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
extern
#ifdef __cplusplus
"C"
/* { dg-additional-options "-std=gnu99" { target c } } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
extern
#ifdef __cplusplus
"C"
/* { dg-additional-options "-std=gnu99" { target c } } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
extern
#ifdef __cplusplus
"C"
/* { dg-additional-options "-std=gnu99" {target c } } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
#define CONDNE
#include "for-3.c"
/* { dg-do link } */
/* { dg-excess-errors "unresolved symbol foo, lto1, mkoffload and lto-wrapper fatal errors" { target { offload_target_nvptx || offload_target_amdgcn } } } */
/* { dg-additional-sources "function-not-offloaded-aux.c" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
#pragma omp declare target
int var;
#pragma omp end declare target
/* { dg-do run { target { ! offload_target_nvptx } } } */
/* { dg-do compile { target offload_target_nvptx } } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
#define N 100
void
/* { dg-do run } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
#include <math.h>
#define N 100
/* { dg-do run } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
#define N 100
int
/* { dg-do run } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
#define N 100
#include <stdio.h>
n = 1;
c++;
}
- #pragma omp ordered depend(source)
+ #pragma omp ordered depend(source) // { dg-warning "'source' modifier with 'depend' clause deprecated since OpenMP 5.2, use with 'doacross' \\\[-Wdeprecated-openmp\\\]" }
if (MONOTONIC_UNDEF > 0)
{
- #pragma omp ordered depend(sink: i)
+ #pragma omp ordered depend(sink: i) // { dg-warning "'sink' modifier with 'depend' clause deprecated since OpenMP 5.2, use with 'doacross' \\\[-Wdeprecated-openmp\\\]" }
}
else
{
- #pragma omp ordered depend(sink: i - 1)
+ #pragma omp ordered depend(sink: i - 1) // { dg-warning "'sink' modifier with 'depend' clause deprecated since OpenMP 5.2, use with 'doacross' \\\[-Wdeprecated-openmp\\\]" }
}
l = i;
}
/* { dg-do run } */
+// { dg-additional-options "-Wno-deprecated-openmp" }
#include <omp.h>
#include <stdlib.h>
/* Based on sollve_vv's tests/5.0/declare_target/test_nested_declare_target.c. */\r
-\r
+// { dg-additional-options "-Wno-deprecated-openmp" }\r
#define N 1024\r
int a[N], b[N], c[N]; \r
int i = 0;\r
/* PR middle-end/66199 */
/* { dg-do run } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
#pragma omp declare target
int u[1024], v[1024], w[1024];
#pragma omp end declare target
/* PR middle-end/66199 */
/* { dg-do run } */
/* { dg-options "-O2" { target c } } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
#pragma omp declare target
int u[1024], v[1024], w[1024];
#pragma omp end declare target
/* PR middle-end/66199 */
/* { dg-do run } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
#pragma omp declare target
int u[1024], v[1024], w[1024];
#pragma omp end declare target
/* PR middle-end/66199 */
/* { dg-do run } */
/* { dg-options "-O2" { target c } } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
#pragma omp declare target
int u[1024], v[1024], w[1024];
#pragma omp end declare target
/* PR middle-end/66199 */
/* { dg-do run } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
#pragma omp declare target
int u[1024], v[1024], w[1024];
#pragma omp end declare target
/* PR middle-end/66199 */
/* { dg-do run } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
#pragma omp declare target
int u[1024], v[1024], w[1024];
#pragma omp end declare target
/* PR middle-end/66199 */
/* { dg-do run } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
#pragma omp declare target
int u[1024], v[1024], w[1024];
#pragma omp end declare target
};
typedef struct S S;
-#pragma omp declare target
+#pragma omp declare target // { dg-warning "use of 'omp declare target' as a synonym for 'omp begin declare target' has been deprecated since OpenMP 5.2 \\\[-Wdeprecated-openmp\\\]" }
int *gp;
#pragma omp end declare target
/* { dg-do run } */
/* { dg-additional-options "-foffload-options=nvptx-none=-misa=sm_35" { target { offload_target_nvptx } } } */
/* { dg-additional-sources reverse-offload-1-aux.c } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
/* Check that reverse offload works in particular:
- no code is generated on the device side (i.e. no
implicit declare target of called functions and no
+// { dg-additional-options "-Wno-deprecated-openmp" }
extern
#ifdef __cplusplus
"C"
/* { dg-do run } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
#pragma omp declare target
extern int v;
#pragma omp end declare target
/* { dg-do run } */
/* { dg-options "-O0" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
extern
#ifdef __cplusplus
"C"
/* { dg-additional-options -O0 } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
#include "target-abi-struct-1.c"
+// { dg-additional-options "-Wno-deprecated-openmp" }
#include "../libgomp.oacc-c-c++-common/abi-struct-1.c"
/* Offloaded 'constructor' and 'destructor' functions. */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
#include <omp.h>
#pragma omp declare target
+// { dg-additional-options "-Wno-deprecated-openmp" }
/* { dg-additional-sources "target-same-name-1-a.c target-same-name-1-b.c" } */
/* PR middle-end/104285 */
+// { dg-additional-options "-Wno-deprecated-openmp" }
extern
#ifdef __cplusplus
"C"
/* { dg-do link } */
/* { dg-excess-errors "lto1, mkoffload and lto-wrapper fatal errors" { target { offload_target_nvptx || offload_target_amdgcn } } } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
int var; /* { dg-error "variable 'var' has been referenced in offloaded code but hasn't been marked to be included in the offloaded code" "" { target { offload_target_nvptx || offload_target_amdgcn } } } */
#pragma omp declare target
/* { dg-additional-options -DOFFLOAD_DEVICE_NVPTX { target offload_device_nvptx } } */
/* { dg-additional-options {-fdump-tree-optimized -foffload-options=-fdump-tree-optimized} } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
#include "declare-variant-3.h"
/* { dg-final { scan-tree-dump "= f \\(\\);" "optimized" } }
/* { dg-additional-options -DOFFLOAD_DEVICE_GCN { target offload_device_gcn } } */
/* { dg-additional-options {-fdump-tree-optimized -foffload-options=-fdump-tree-optimized} } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
#include "declare-variant-4.h"
/* { dg-final { scan-tree-dump "= f \\(\\);" "optimized" } }
+// { dg-additional-options "-Wno-deprecated-openmp" }
extern void abort (void);
#define N 256
+// { dg-additional-options "-Wno-deprecated-openmp" }
extern void abort (void);
#define N 256
+// { dg-additional-options "-Wno-deprecated-openmp" }
extern void abort (void);
#define N 256
/* { dg-do run } */
/* { dg-additional-options "-DCHUNKSZ=5000" { target { ! run_expensive_tests } } } */
/* { dg-additional-options "-DCHUNKSZ=1000" { target run_expensive_tests } } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
#include <stdlib.h>
#define EPS 0.00001
/* { dg-do run } */
+// { dg-additional-options "-Wno-deprecated-openmp" }
#include <stdlib.h>
/* { dg-do run } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
#include <stdlib.h>
#define EPS 0.000001
/* { dg-do run } */
/* { dg-additional-options "-DTESTITERS=20" { target { ! run_expensive_tests } } } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
#include <stdlib.h>
#define EPS 0.00001
/* { dg-do run { target vect_simd_clones } } */
/* { dg-additional-options "-msse2" { target sse2_runtime } } */
/* { dg-additional-options "-mavx" { target avx_runtime } } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
#include <stdlib.h>
#define EPS 0.00001
/* Fix a max_vf size so we can scan for it.
{ dg-additional-options "-msse2 -mno-avx" { target { x86_64-*-* i?86-*-* } } } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
#define N 1024
int a[N], b[N], c[N];
/* Minimized from for-5.c. */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
#include <stdio.h>
#include <stdlib.h>
+// { dg-additional-options "-Wno-deprecated-openmp" }
/* PR middle-end/86660 */
#pragma omp declare target
+// { dg-additional-options "-Wno-deprecated-openmp" }
#include <omp.h>
#include <stdlib.h>
if (i != 0 || k != 0 || l != 0)
#pragma omp atomic
j |= 1;
-
+
if (omp_get_num_threads () != 4)
#pragma omp atomic
j |= 2;
/* PR tree-optimization/85063 */
/* { dg-additional-options "-ftree-switch-conversion" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
#include <stdlib.h>
#pragma omp declare target
+// { dg-additional-options "-Wno-deprecated-openmp" }
extern void abort (void);
#pragma omp declare target
int a[4] = { 2, 3, 4, 5 }, *b;
+// { dg-additional-options "-Wno-deprecated-openmp" }
extern void abort (void);
int g;
+// { dg-additional-options "-Wno-deprecated-openmp" }
extern void abort (void);
#pragma omp declare target
+// { dg-additional-options "-Wno-deprecated-openmp" }
#include <stdlib.h>
#include <unistd.h>
#include "usleep.h"
+// { dg-additional-options "-Wno-deprecated-openmp" }
#include <omp.h>
#include <stdlib.h>
+// { dg-additional-options "-Wno-deprecated-openmp" }
#define A(n) n##0, n##1, n##2, n##3, n##4, n##5, n##6, n##7, n##8, n##9
#define B(n) A(n##0), A(n##1), A(n##2), A(n##3), A(n##4), A(n##5), A(n##6), A(n##7), A(n##8), A(n##9)
/* { dg-do run } */
/* { dg-options "-O0" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
extern void abort (void);
volatile int v;
#pragma omp declare target to (v)
/* { dg-do run } */
/* { dg-options "-O1 -ftree-parallelize-loops=0" } */
/* { dg-additional-options "-flto" { target lto } } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
#include <stdlib.h>
#define N 123456
+// { dg-additional-options "-Wno-deprecated-openmp" }
struct S { int s, t; };
int a = 1, b = 1;
/* { dg-do run } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
#include <omp.h>
#include <stdlib.h>
/* { dg-do run } */
/* { dg-set-target-env-var OMP_THREAD_LIMIT "9" } */
/* { dg-additional-options "-Wno-deprecated-declarations" } */
-
+// { dg-additional-options "-Wno-deprecated-openmp" }
#include <stdlib.h>
#include <unistd.h>
#include <omp.h>
/* { dg-additional-options "-DEXPENSIVE" { target run_expensive_tests } } */
/* { dg-additional-options -Wuninitialized } */
+// { dg-additional-options "-Wno-deprecated-openmp" }
#include <assert.h>