You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: clang/test/Cilk/rangelooptest.cpp
+19-17Lines changed: 19 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -53,40 +53,42 @@ int Cilk_for_range_tests(int n) {
53
53
for (int i = 0; i < n; i++)
54
54
v[i] = i;
55
55
56
-
_Cilk_for(auto x : v); // expected-warning {{range-based for loop has empty body}} expected-warning {{Cilk for loop has empty body}} expected-warning {{'_Cilk_for' support for for-range loops is currently EXPERIMENTAL only!}}
57
-
_Cilk_for(auto &x : v); // expected-warning {{range-based for loop has empty body}} expected-warning {{Cilk for loop has empty body}} expected-warning {{'_Cilk_for' support for for-range loops is currently EXPERIMENTAL only!}}
58
-
_Cilk_for(int x : v); // expected-warning {{range-based for loop has empty body}} expected-warning {{Cilk for loop has empty body}} expected-warning {{'_Cilk_for' support for for-range loops is currently EXPERIMENTAL only!}}
59
-
_Cilk_for(StdMock::Empty x : v); // expected-warning {{range-based for loop has empty body}} expected-warning {{Cilk for loop has empty body}} expected-error {{no viable conversion from 'int' to 'StdMock::Empty'}} expected-warning {{'_Cilk_for' support for for-range loops is currently EXPERIMENTAL only!}}
56
+
_Cilk_for(auto x : v); // expected-warning {{range-based for loop has empty body}} expected-warning {{'cilk_for' loop has empty body}} expected-warning {{'cilk_for' support for for-range loops is currently EXPERIMENTAL only!}}
57
+
_Cilk_for(auto &x : v); // expected-warning {{range-based for loop has empty body}} expected-warning {{'cilk_for' loop has empty body}} expected-warning {{'cilk_for' support for for-range loops is currently EXPERIMENTAL only!}}
58
+
_Cilk_for(int x : v); // expected-warning {{range-based for loop has empty body}} expected-warning {{'cilk_for' loop has empty body}} expected-warning {{'cilk_for' support for for-range loops is currently EXPERIMENTAL only!}}
59
+
_Cilk_for(StdMock::Empty x : v); // expected-warning {{range-based for loop has empty body}} expected-warning {{'cilk_for' loop has empty body}} expected-error {{no viable conversion from 'int' to 'StdMock::Empty'}} expected-error {{no viable conversion from 'int' to 'StdMock::Empty'}} expected-warning {{'cilk_for' support for for-range loops is currently EXPERIMENTAL only!}}
60
+
// in line above, the "no viable conversion" error comes twice because of the new CodeGen structure of cilk_for_range loops, which now adds an extra check to the initial condition before entering the loop ("pfor.initial.entry")
61
+
60
62
61
63
// Pairs are aggregate types, which initially had a bug. Assert that they work
62
64
StdMock::Vector<StdMock::Pair<int, int>> vp(n);
63
65
for (int i = 0; i < n; i++) {
64
66
vp[i] = {i, i + 1};
65
67
}
66
-
_Cilk_for(auto p : vp) // expected-warning {{'_Cilk_for' support for for-range loops is currently EXPERIMENTAL only!}}
68
+
_Cilk_for(auto p : vp) // expected-warning {{'cilk_for' support for for-range loops is currently EXPERIMENTAL only!}}
67
69
continue;
68
-
_Cilk_for(auto &p : vp) { // expected-warning {{'_Cilk_for' support for for-range loops is currently EXPERIMENTAL only!}}
70
+
_Cilk_for(auto &p : vp) { // expected-warning {{'cilk_for' support for for-range loops is currently EXPERIMENTAL only!}}
69
71
continue;
70
72
}
71
73
72
74
int a[5];
73
-
_Cilk_for(int x : a) // expected-warning {{'_Cilk_for' support for for-range loops is currently EXPERIMENTAL only!}}
75
+
_Cilk_for(int x : a) // expected-warning {{'cilk_for' support for for-range loops is currently EXPERIMENTAL only!}}
74
76
continue;
75
77
76
78
StdMock::Set<int> s(n);
77
-
_Cilk_for(int x : s); // expected-error {{Cannot determine length with '__end - __begin'. Please use a random access iterator.}} expected-error {{invalid operands to binary expression ('StdMock::Set<int>::It' and 'StdMock::Set<int>::It')}} expected-warning {{'_Cilk_for' support for for-range loops is currently EXPERIMENTAL only!}}
79
+
_Cilk_for(int x : s); // expected-error {{Cannot determine length with '__end - __begin'. Please use a random access iterator.}} expected-error {{invalid operands to binary expression ('It' and 'It')}} expected-warning {{'cilk_for' support for for-range loops is currently EXPERIMENTAL only!}}
78
80
79
81
// Check for return statements, which cannot appear anywhere in the body of a
80
82
// _Cilk_for loop.
81
-
_Cilk_for(int i : v) return7; // expected-error{{cannot return}} expected-warning {{'_Cilk_for' support for for-range loops is currently EXPERIMENTAL only!}}
82
-
_Cilk_for(int i : v) // expected-warning {{'_Cilk_for' support for for-range loops is currently EXPERIMENTAL only!}}
83
+
_Cilk_for(int i : v) return7; // expected-error{{cannot return}} expected-warning {{'cilk_for' support for for-range loops is currently EXPERIMENTAL only!}}
84
+
_Cilk_for(int i : v) // expected-warning {{'cilk_for' support for for-range loops is currently EXPERIMENTAL only!}}
83
85
for (int j = 1; j < i; ++j)
84
86
return7; // expected-error{{cannot return}}
85
87
86
88
// Check for illegal break statements, which cannot bind to the scope of a
87
89
// _Cilk_for loop, but can bind to loops nested within.
88
-
_Cilk_for(int i : v) break; // expected-error{{cannot break}} expected-warning {{'_Cilk_for' support for for-range loops is currently EXPERIMENTAL only!}}
89
-
_Cilk_for(int i : v) // expected-warning {{'_Cilk_for' support for for-range loops is currently EXPERIMENTAL only!}}
90
+
_Cilk_for(int i : v) break; // expected-error{{cannot break}} expected-warning {{'cilk_for' support for for-range loops is currently EXPERIMENTAL only!}}
91
+
_Cilk_for(int i : v) // expected-warning {{'cilk_for' support for for-range loops is currently EXPERIMENTAL only!}}
90
92
for (int j = 1; j < i; ++j)
91
93
break;
92
94
@@ -99,19 +101,19 @@ int range_pragma_tests(int n) {
99
101
v[i] = i;
100
102
101
103
#pragma clang loop unroll_count(4)
102
-
_Cilk_for(auto i : v) // expected-warning {{'_Cilk_for' support for for-range loops is currently EXPERIMENTAL only!}}
104
+
_Cilk_for(auto i : v) // expected-warning {{'cilk_for' support for for-range loops is currently EXPERIMENTAL only!}}
103
105
foo(i);
104
106
105
107
#pragma cilk grainsize(4)
106
-
_Cilk_for(int i : v) // expected-warning {{'_Cilk_for' support for for-range loops is currently EXPERIMENTAL only!}}
108
+
_Cilk_for(int i : v) // expected-warning {{'cilk_for' support for for-range loops is currently EXPERIMENTAL only!}}
107
109
foo(i);
108
110
109
111
#pragma cilk grainsize 4
110
-
_Cilk_for(auto i : v) // expected-warning {{'_Cilk_for' support for for-range loops is currently EXPERIMENTAL only!}}
112
+
_Cilk_for(auto i : v) // expected-warning {{'cilk_for' support for for-range loops is currently EXPERIMENTAL only!}}
0 commit comments