1 // { dg-additional-options "-Wno-volatile" }
4 struct S { int a[4]; } k;
7 #define TEST_EQ(x,y) ({ int o[x == y ? 1 : -1]; 0; })
9 template <typename T, typename U, typename V, typename W, int N>
11 foo (unsigned char i, signed char j)
13 #pragma omp task depend (iterator (T j=6:N:-2) , out : \
14 arr[TEST_EQ (sizeof (j), sizeof (int)), \
15 TEST_EQ (sizeof (i), sizeof (unsigned char)), \
16 TEST_EQ (sizeof (k), sizeof (struct S)), j], \
17 arr2[TEST_EQ (((__typeof (j)) -1) < 0, 1), \
18 TEST_EQ (((__typeof (i)) -1) < 0, 0), \
19 TEST_EQ (((__typeof (k.a[0])) -1) < 0, 1), j]) \
21 depend (iterator (U i=__LONG_LONG_MAX__ - 4:__LONG_LONG_MAX__ - N:N, \
23 W *k=&arr4[1]:&arr4[2]:1) , in : \
24 arr[TEST_EQ (sizeof (i), sizeof (long long)), \
25 TEST_EQ (sizeof (j), sizeof (unsigned short)), \
26 TEST_EQ (sizeof (k), sizeof (short *)), \
27 TEST_EQ (sizeof (*k), sizeof (short)), i - __LONG_LONG_MAX__ + 4], \
28 arr2[TEST_EQ (((__typeof (i)) -1) < 0, 1), \
29 TEST_EQ (((__typeof (j)) -1) < 0, 0), \
30 TEST_EQ (((__typeof (*k)) -1) < 0, 1), j - (~0U-16)], \
36 template <typename U, typename W, int N>
38 bar (unsigned char i, signed char j)
42 #pragma omp task depend (iterator (j=N:2:m) , out : \
43 arr[TEST_EQ (sizeof (j), sizeof (int)), \
44 TEST_EQ (sizeof (i), sizeof (unsigned char)), \
45 TEST_EQ (sizeof (k), sizeof (struct S)), j], \
46 arr2[TEST_EQ (((__typeof (j)) -1) < 0, 1), \
47 TEST_EQ (((__typeof (i)) -1) < 0, 0), \
48 TEST_EQ (((__typeof (k.a[0])) -1) < 0, 1), j]) \
50 depend (iterator (U i=__LONG_LONG_MAX__ - 4 - n:__LONG_LONG_MAX__ - 2:2, \
51 unsigned short j=~0U-16:~0U-8-n:3, \
52 W k=&arr4[N-5]:&arr4[n + 2]:1) , in : \
53 arr[TEST_EQ (sizeof (i), sizeof (long long)), \
54 TEST_EQ (sizeof (j), sizeof (unsigned short)), \
55 TEST_EQ (sizeof (k), sizeof (short *)), \
56 TEST_EQ (sizeof (*k), sizeof (short)), i - __LONG_LONG_MAX__ + 4], \
57 arr2[TEST_EQ (((__typeof (i)) -1) < 0, 1), \
58 TEST_EQ (((__typeof (j)) -1) < 0, 0), \
59 TEST_EQ (((__typeof (*k)) -1) < 0, 1), j - (~0U-16)], \
60 arr2[k - &arr4[0]:10]) \
65 template <typename T, typename U, int N>
72 #pragma omp task depend(iterator(T k = N : 2) , inout : \
73 arr[TEST_EQ (sizeof (k), sizeof (unsigned long)), \
74 TEST_EQ (((__typeof (k)) -1) < N, 0), k]) \
75 depend(iterator(U s = -3 : -12 : -1 + N) , out : \
76 arr[TEST_EQ (sizeof (s), sizeof (signed char)), \
77 TEST_EQ (((__typeof (s)) -1) < 0, 1), s + 12])
85 foo <int, long long, unsigned short, short, 2> (0, 0);
86 bar <long long, short *, 6> (0, -2);
87 baz <unsigned long int, signed char, 0> ();