Debian Codegraph @

gcc/testsuite/g++.dg/gomp/pr89796.C

raw
1 // PR c++/89796
2 // { dg-do compile }
3 // { dg-additional-options "-Wunused-value" }
4
5 int
6 f1 (int &c)
7 {
8 int r;
9 #pragma omp atomic capture // { dg-bogus "value computed is not used" }
10 { r = c; c++; }
11 return r;
12 }
13
14 template <int N>
15 int
16 f2 (int &c)
17 {
18 int r;
19 #pragma omp atomic capture // { dg-bogus "value computed is not used" }
20 { r = c; c++; }
21 return r;
22 }
23
24 int
25 f3 (int &c)
26 {
27 return f2 <0> (c);
28 }
29
30 int
31 f4 (int *p)
32 {
33 int r;
34 #pragma omp atomic capture // { dg-bogus "value computed is not used" }
35 { r = *p; (*p)++; }
36 return r;
37 }
38
39 template <int N>
40 int
41 f5 (int *p)
42 {
43 int r;
44 #pragma omp atomic capture // { dg-bogus "value computed is not used" }
45 { r = *p; (*p)++; }
46 return r;
47 }
48
49 int
50 f6 (int *p)
51 {
52 return f5 <0> (p);
53 }