annotate gcc/testsuite/c-c++-common/cilk-plus/SE/ef_test.c @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* { dg-do compile } */
kono
parents:
diff changeset
2 /* { dg-options "-fcilkplus -Wunknown-pragmas" } */
kono
parents:
diff changeset
3
kono
parents:
diff changeset
4 /* Tests the clauses in several combinations put in different locations. */
kono
parents:
diff changeset
5 /* This is mostly a parser test. */
kono
parents:
diff changeset
6 #define Q 4
kono
parents:
diff changeset
7
kono
parents:
diff changeset
8 int z = Q;
kono
parents:
diff changeset
9
kono
parents:
diff changeset
10 __attribute__ ((vector (uniform(x), linear (y:1), vectorlength (4) )))
kono
parents:
diff changeset
11 int func (int x, int y)
kono
parents:
diff changeset
12 {
kono
parents:
diff changeset
13 int zq = 5;
kono
parents:
diff changeset
14 return x + (y*zq);
kono
parents:
diff changeset
15 }
kono
parents:
diff changeset
16 __attribute__ ((__vector__ (uniform(x), vectorlength (2), linear (y:1) )))
kono
parents:
diff changeset
17 int func2 (int x, int y)
kono
parents:
diff changeset
18 {
kono
parents:
diff changeset
19 int zq = 5;
kono
parents:
diff changeset
20 return x + (y*zq);
kono
parents:
diff changeset
21 }
kono
parents:
diff changeset
22
kono
parents:
diff changeset
23 __attribute__ ((vector (uniform(y), linear (x), vectorlength (4) )))
kono
parents:
diff changeset
24 int func3 (int x, int y)
kono
parents:
diff changeset
25 {
kono
parents:
diff changeset
26 int zq = 5;
kono
parents:
diff changeset
27 return x + (y*zq);
kono
parents:
diff changeset
28 }
kono
parents:
diff changeset
29
kono
parents:
diff changeset
30 __attribute__ ((vector (uniform(x), linear (y:1), mask)))
kono
parents:
diff changeset
31 int func4 (int x, int y)
kono
parents:
diff changeset
32 {
kono
parents:
diff changeset
33 int zq = 5;
kono
parents:
diff changeset
34 return x + (y*zq);
kono
parents:
diff changeset
35 }
kono
parents:
diff changeset
36
kono
parents:
diff changeset
37 __attribute__ ((vector (uniform(x), linear (y:1), nomask)))
kono
parents:
diff changeset
38 int func5 (int x, int y)
kono
parents:
diff changeset
39 {
kono
parents:
diff changeset
40 int zq = 5;
kono
parents:
diff changeset
41 return x + (y*zq);
kono
parents:
diff changeset
42 }
kono
parents:
diff changeset
43
kono
parents:
diff changeset
44 __attribute__ ((vector (uniform(x), mask, linear (y:1))))
kono
parents:
diff changeset
45 int func6 (int x, int y)
kono
parents:
diff changeset
46 {
kono
parents:
diff changeset
47 int zq = 5;
kono
parents:
diff changeset
48 return x + (y*zq);
kono
parents:
diff changeset
49 }
kono
parents:
diff changeset
50
kono
parents:
diff changeset
51 __attribute__ ((vector (uniform (x), mask, linear (y:1)), vector))
kono
parents:
diff changeset
52 int func7 (int x, int y)
kono
parents:
diff changeset
53 {
kono
parents:
diff changeset
54 int zq = 5;
kono
parents:
diff changeset
55 return x + (y*zq);
kono
parents:
diff changeset
56 }
kono
parents:
diff changeset
57
kono
parents:
diff changeset
58 __attribute__ ((vector (uniform (x), mask, linear (y:1)), vector (uniform (y), mask)))
kono
parents:
diff changeset
59 int func8 (int x, int y)
kono
parents:
diff changeset
60 {
kono
parents:
diff changeset
61 int zq = 5;
kono
parents:
diff changeset
62 return x + (y*zq);
kono
parents:
diff changeset
63 }
kono
parents:
diff changeset
64
kono
parents:
diff changeset
65 __attribute__ ((vector, vector (uniform (y), mask)))
kono
parents:
diff changeset
66 int func9 (int x, int y)
kono
parents:
diff changeset
67 {
kono
parents:
diff changeset
68 int zq = 5;
kono
parents:
diff changeset
69 return x + (y*zq);
kono
parents:
diff changeset
70 }
kono
parents:
diff changeset
71
kono
parents:
diff changeset
72 int main (int argc, char *argv[])
kono
parents:
diff changeset
73 {
kono
parents:
diff changeset
74 int ii = 0, q = 5;
kono
parents:
diff changeset
75 for (ii = 0; ii < 10; ii++)
kono
parents:
diff changeset
76 q += func (argc, ii);
kono
parents:
diff changeset
77 return q;
kono
parents:
diff changeset
78 }