1.2.33. test/regress/rt-1.01.33

     1: #line 1218 "./lpsrc/flx_regress.pak"
     2: //Check ref semantics
Start felix section to test/regress/rt-1.01.33-0.flx[1 /1 ]
     3: #include <flx.flxh>
     4: 
     5: noinline proc f(var x:int, val y:int)
     6: {
     7:   print$ x; endl;
     8:   ++x;
     9:   print$ x; endl;
    10: 
    11:   print$ y; endl;
    12:   //++y;
    13:   //print$ y; endl;
    14: }
    15: 
    16: call f$ 3, 1;
    17: var a = 1;
    18: call f$ a, a;
    19: print "------------------\n";
    20: 
    21: inline proc g(var x:int, val y:int)
    22: {
    23:   print$ x; endl;
    24:   ++x;
    25:   print$ x; endl;
    26: 
    27:   print$ y; endl;
    28:   //++y;
    29:   //print$ y; endl;
    30: }
    31: 
    32: call g$ 3, 1;
    33: var b = 1;
    34: call g$ b, b;
    35: 
    36: noinline proc r(x:int, ref y:int)
    37: {
    38:   var z = case 1 of (int + long);
    39:   print$ y; endl;
    40:   y++;
    41:   print $y; endl;
    42: }
    43: 
    44: inline proc s(x:int, ref y:int)
    45: {
    46:   var z = case 1 of (int + long);
    47:   print$ y; endl;
    48:   y++;
    49:   print $y; endl;
    50: }
    51: 
    52: a = 66;
    53: 
    54: print "------------------\n";
    55: r$ 1, &a;
    56: print a; endl;
    57: 
    58: print "------------------\n";
    59: s$ 1, &a;
    60: print a; endl;
    61: print "------------------\n";
    62: 
    63: noinline proc h(fun y: int)
    64: {
    65:   print$ y; endl;
    66:   ++a;
    67:   print$ y; endl;
    68: }
    69: 
    70: inline proc k(fun y: int)
    71: {
    72:   print$ y; endl;
    73:   ++a;
    74:   print$ y; endl;
    75: 
    76: }
    77: 
    78: h { a+1 };
    79: k { a +1 };
End felix section to test/regress/rt-1.01.33-0.flx[1]
Start data section to test/regress/rt-1.01.33-0.expect[1 /1 ]
     1: 3
     2: 4
     3: 1
     4: 1
     5: 2
     6: 1
     7: ------------------
     8: 3
     9: 4
    10: 1
    11: 1
    12: 2
    13: 1
    14: ------------------
    15: 66
    16: 67
    17: 67
    18: ------------------
    19: 67
    20: 68
    21: 68
    22: ------------------
    23: 69
    24: 70
    25: 70
    26: 71
End data section to test/regress/rt-1.01.33-0.expect[1]