source: src/tests/sched-ext-parse.c@ 4cc9b13

ADT aaron-thesis arm-eh ast-experimental cleanup-dtors deferred_resn demangler enum forall-pointer-decay jacob/cs343-translation jenkins-sandbox new-ast new-ast-unique-expr new-env no_list persistent-indexer pthread-emulation qualifiedEnum resolv-new with_gc
Last change on this file since 4cc9b13 was 8f98b78, checked in by Thierry Delisle <tdelisle@…>, 8 years ago

Now properly resolve the calls to get_monitor

  • Property mode set to 100644
File size: 1.3 KB
Line 
1#include <monitor>
2
3monitor M {};
4
5M a;
6
7void f1( M & mutex a );
8void f2( M & mutex a );
9void f2( M & mutex a, M & mutex b );
10void f3( M & mutex a );
11void f3( M & mutex a, M & mutex b );
12void f3( M & mutex a, M & mutex b, M & mutex c );
13
14void foo() {
15
16 //---------------------------------------
17 waitfor( f1, a ) {
18 1;
19 }
20
21 //---------------------------------------
22 waitfor( f1, a ) {
23 2;
24 }
25 waitfor( f2, a ) {
26 3;
27 }
28
29 //---------------------------------------
30 when( 1 < 3 ) waitfor( f2, a, a ) {
31 4;
32 }
33 or timeout( 100 ) {
34 5;
35 }
36
37 //---------------------------------------
38 when( 2 < 3 ) waitfor( f3, a ) {
39 5;
40 }
41 or else {
42 6;
43 }
44
45 //---------------------------------------
46 when( 3 < 3 ) waitfor( f3, a, a ) {
47 7;
48 }
49 or when( 4 < 3 ) timeout( 101 ) {
50 8;
51 }
52 or when( 5 < 3 ) else {
53 9;
54 }
55
56 //---------------------------------------
57 when( 6 < 3 ) waitfor( f3, a, a, a ) {
58 10;
59 }
60 or when( 7 < 3 ) waitfor( f1, a ) {
61 11;
62 }
63 or else {
64 12;
65 }
66
67 //---------------------------------------
68 when( 8 < 3 ) waitfor( f3, a, a ) {
69 13;
70 }
71 or waitfor( f1, a ) {
72 14;
73 }
74 or when( 9 < 3 ) timeout( 102 ) {
75 15;
76 }
77
78 //---------------------------------------
79 when( 10 < 3 ) waitfor( f1, a ) {
80 16;
81 }
82 or waitfor( f2, a, a ) {
83 17;
84 }
85 or timeout( 103 ) {
86 18;
87 }
88 or when( 11 < 3 ) else {
89 19;
90 }
91}
92
93int main() {
94
95}
Note: See TracBrowser for help on using the repository browser.