]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/g++.dg/cilk-plus/CK/stl_test.cc
[Patch AArch64] Fixup floating point division with -march=armv8-a+nosimd
[thirdparty/gcc.git] / gcc / testsuite / g++.dg / cilk-plus / CK / stl_test.cc
1 /* { dg-do run } */
2 /* { dg-require-effective-target cilkplus_runtime } */
3 /* { dg-options "-fcilkplus" } */
4
5
6 #include <iostream>
7 #include <cstdio>
8 #include <cstdlib>
9 #include <vector>
10 #include <algorithm>
11 #include <list>
12
13 using namespace std;
14
15
16 int main(int argc, char **argv)
17 {
18 vector <int> number_list, number_list_serial;
19 int new_number = 0;
20 int no_elements = 0;
21
22 if (argc != 2)
23 {
24 no_elements = 10;
25 }
26
27
28 number_list.clear();
29 number_list_serial.clear();
30 for (int ii = 0; ii < no_elements; ii++)
31 {
32 number_list.push_back(new_number);
33 number_list_serial.push_back(new_number);
34 }
35
36 _Cilk_for (int jj = 0; jj < no_elements; jj++)
37 {
38 number_list[jj] = jj + no_elements;
39 }
40 for (int jj = 0; jj < no_elements; jj++)
41 {
42 number_list_serial[jj] = jj + no_elements;
43 }
44
45 for (int jj = 0; jj < no_elements; jj++)
46 if (number_list_serial[jj] != number_list[jj])
47 __builtin_abort ();
48
49 return 0;
50 }