sched1: debug/model: dump predecessor list and BB num [NFC]
[gcc.git] / libgomp / testsuite / libgomp.c / target-5.c
blob20b1b4d2474adb58c3cbce584aaae23d1b124826
1 /* { dg-additional-options "-Wno-deprecated-declarations" } */
3 #include <omp.h>
4 #include <stdlib.h>
6 int
7 main ()
9 int d_o = omp_get_dynamic ();
10 int n_o = omp_get_nested ();
11 omp_sched_t s_o;
12 int c_o;
13 omp_get_schedule (&s_o, &c_o);
14 int m_o = omp_get_max_threads ();
15 omp_set_dynamic (1);
16 omp_set_nested (1);
17 omp_set_schedule (omp_sched_static, 2);
18 omp_set_num_threads (4);
19 int d = omp_get_dynamic ();
20 int n = omp_get_nested ();
21 omp_sched_t s;
22 int c;
23 omp_get_schedule (&s, &c);
24 int m = omp_get_max_threads ();
25 if (!omp_is_initial_device ())
26 abort ();
27 #pragma omp target if (0)
29 omp_sched_t s_c;
30 int c_c;
31 omp_get_schedule (&s_c, &c_c);
32 if (d_o != omp_get_dynamic ()
33 || n_o != omp_get_nested ()
34 || s_o != s_c
35 || c_o != c_c
36 || m_o != omp_get_max_threads ())
37 abort ();
38 omp_set_dynamic (0);
39 omp_set_nested (0);
40 omp_set_schedule (omp_sched_dynamic, 4);
41 omp_set_num_threads (2);
42 if (!omp_is_initial_device ())
43 abort ();
45 if (!omp_is_initial_device ())
46 abort ();
47 omp_sched_t s_c;
48 int c_c;
49 omp_get_schedule (&s_c, &c_c);
50 if (d != omp_get_dynamic ()
51 || n != omp_get_nested ()
52 || s != s_c
53 || c != c_c
54 || m != omp_get_max_threads ())
55 abort ();
56 #pragma omp target if (0)
57 #pragma omp teams
58 #pragma omp parallel if(0)
60 omp_sched_t s_c;
61 int c_c;
62 omp_get_schedule (&s_c, &c_c);
63 if (d_o != omp_get_dynamic ()
64 || n_o != omp_get_nested ()
65 || s_o != s_c
66 || c_o != c_c
67 || m_o != omp_get_max_threads ())
68 abort ();
69 omp_set_dynamic (0);
70 omp_set_nested (0);
71 omp_set_schedule (omp_sched_dynamic, 4);
72 omp_set_num_threads (2);
73 if (!omp_is_initial_device ())
74 abort ();
76 if (!omp_is_initial_device ())
77 abort ();
78 omp_get_schedule (&s_c, &c_c);
79 if (d != omp_get_dynamic ()
80 || n != omp_get_nested ()
81 || s != s_c
82 || c != c_c
83 || m != omp_get_max_threads ())
84 abort ();
85 return 0;