* c-c++-common/Wrestrict.c (test_strcpy_range): Revert latest change.
[official-gcc.git] / libgomp / testsuite / libgomp.oacc-c-c++-common / vprop-2.c
blob046ac68014b4206ffd0b749a9aae9d60d3785fb8
1 /* { dg-do run } */
3 #include <assert.h>
5 #define DO_PRAGMA(x) _Pragma (#x)
7 #define test(idx,type,ngangs) \
8 void \
9 test_##idx () \
10 { \
11 int b[100]; \
13 for (unsigned int i = 0; i < 100; i++) \
14 b[i] = 0; \
16 DO_PRAGMA(acc parallel num_gangs (ngangs) copy (b)) \
17 { \
18 _Pragma("acc loop gang") \
19 for (type j = 0; j < 5; j++) \
20 { \
21 _Pragma("acc loop vector") \
22 for (unsigned int i = 0; i < 20; i++) \
23 b[j * 20 + i] = -2; \
24 } \
25 } \
27 for (unsigned int i = 0; i < 100; i++) \
28 assert (b[i] == -2); \
31 test (0, signed char, 256)
32 test (1, unsigned char, 256)
33 test (2, signed short, 65535)
34 test (3, unsigned short, 65535)
36 int
37 main ()
39 test_0 ();
40 test_1 ();
41 test_2 ();
42 test_3 ();
44 return 0;