summaryrefslogtreecommitdiff
path: root/test/cases/rlhc.d/case/cond1_go.go-Z-T1--var-backend.exp
diff options
context:
space:
mode:
Diffstat (limited to 'test/cases/rlhc.d/case/cond1_go.go-Z-T1--var-backend.exp')
-rw-r--r--test/cases/rlhc.d/case/cond1_go.go-Z-T1--var-backend.exp382
1 files changed, 382 insertions, 0 deletions
diff --git a/test/cases/rlhc.d/case/cond1_go.go-Z-T1--var-backend.exp b/test/cases/rlhc.d/case/cond1_go.go-Z-T1--var-backend.exp
new file mode 100644
index 00000000..d77d572b
--- /dev/null
+++ b/test/cases/rlhc.d/case/cond1_go.go-Z-T1--var-backend.exp
@@ -0,0 +1,382 @@
+package main
+import "fmt"
+
+var i int ;
+var j int ;
+var k int ;
+
+
+
+
+var cs int;
+var blen int;
+var buffer [1024] byte;
+
+var _foo_key_offsets [] int8 = [] int8 { 0, 0, 2, 4, 6, 8, 10, 12, 13, 14, 15, 16, 17, 18, 19, 20, 0 }
+var _foo_trans_keys [] byte = [] byte { 48, 49, 48, 49, 48, 49, 97, 98, 97, 98, 97, 98, 99, 10, 99, 99, 99, 99, 99, 99, 0 }
+var _foo_single_lengths [] int8 = [] int8 { 0, 0, 0, 0, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0 }
+var _foo_range_lengths [] int8 = [] int8 { 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
+var _foo_index_offsets [] int8 = [] int8 { 0, 0, 2, 4, 6, 9, 12, 15, 17, 19, 21, 23, 25, 27, 29, 31, 0 }
+var _foo_trans_cond_spaces [] int8 = [] int8 { -1, -1, -1, -1, -1, -1, -1, 1, -1, -1, 5, -1, -1, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0 }
+var _foo_trans_offsets [] int8 = [] int8 { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 17, 18, 19, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 0 }
+var _foo_trans_lengths [] int8 = [] int8 { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 7, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0 }
+var _foo_cond_keys [] int8 = [] int8 { 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 2, 3, 4, 5, 6, 7, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
+var _foo_cond_targs [] int8 = [] int8 { 2, 0, 3, 0, 4, 0, 5, 7, 0, 6, 11, 7, 12, 9, 13, 10, 14, 0, 6, 7, 9, 10, 0, 8, 0, 15, 0, 8, 0, 8, 0, 8, 0, 8, 0, 8, 0, 8, 0, 0, 0 }
+var _foo_cond_actions [] int8 = [] int8 { 1, 0, 2, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 5, 0, 6, 0, 7, 0, 8, 0, 9, 0, 10, 0, 11, 0, 0, 0 }
+var _foo_nfa_targs [] int8 = [] int8 { 0, 0 }
+var _foo_nfa_offsets [] int8 = [] int8 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
+var _foo_nfa_push_actions [] int8 = [] int8 { 0, 0 }
+var _foo_nfa_pop_trans [] int8 = [] int8 { 0, 0 }
+var foo_start int = 1
+var foo_first_final int = 15
+var foo_error int = 0
+var foo_en_main int = 1
+func prepare() {
+
+ {
+ cs = int(foo_start);
+ }
+}
+
+func exec(data string) {
+ var p int = 0
+ var pe int = len(data)
+
+ {
+ var _klen int
+ var _keys int
+ var _ckeys int
+ var _cpc int
+ var _trans uint
+ var _cond uint = 0
+ var _have uint = 0
+ var _cont uint = 1
+ for _cont == 1 {
+ {
+
+ if cs == 0 {
+ _cont = 0;
+
+ }
+ _have = 0;
+ if p == pe {
+ {
+ if _have == 0 {
+ _cont = 0;
+
+ }
+ }
+
+ }
+ if _cont == 1 {
+ {
+ if _have == 0 {
+ {
+ _keys = int(_foo_key_offsets[cs] );
+ _trans = uint(_foo_index_offsets[cs]);
+ _have = 0;
+ _klen = int(_foo_single_lengths[cs]);
+ if _klen > 0 {
+ {
+ var _lower int
+ var _mid int
+ var _upper int
+ _lower = _keys;
+ _upper = _keys + _klen - 1;
+ for _upper >= _lower && _have == 0 {
+ {
+ _mid = _lower + ((_upper-_lower) >> 1);
+ switch {
+ case ( data[p ]) < _foo_trans_keys[_mid ]:
+ _upper = _mid - 1;
+
+ case ( data[p ]) > _foo_trans_keys[_mid ]:
+ _lower = _mid + 1;
+
+ default:
+ {
+ _trans += uint((_mid - _keys));
+ _have = 1;
+ }
+
+ }
+ }
+
+ }
+ if _have == 0 {
+ {
+ _keys += _klen;
+ _trans += uint(_klen);
+ }
+
+ }
+ }
+
+
+ }
+ if _have == 0 {
+ {
+ _klen = int(_foo_range_lengths[cs]);
+ if _klen > 0 {
+ {
+ var _lower int
+ var _mid int
+ var _upper int
+ _lower = _keys;
+ _upper = _keys + (_klen<<1) - 2;
+ for _have == 0 && _lower <= _upper {
+ {
+ _mid = _lower + (((_upper-_lower) >> 1) & ^1);
+ switch {
+ case ( data[p ]) < _foo_trans_keys[_mid ]:
+ _upper = _mid - 2;
+
+ case ( data[p ]) > _foo_trans_keys[_mid + 1 ]:
+ _lower = _mid + 2;
+
+ default:
+ {
+ _trans += uint(((_mid - _keys)>>1));
+ _have = 1;
+ }
+
+ }
+ }
+
+ }
+ if _have == 0 {
+ _trans += uint(_klen);
+
+ }
+ }
+
+ }
+ }
+
+
+ }
+ _ckeys = int(_foo_trans_offsets[_trans] );
+ _klen = int(_foo_trans_lengths[_trans]);
+ _cond = uint(_foo_trans_offsets[_trans]);
+ _have = 0;
+ _cpc = 0;
+ switch _foo_trans_cond_spaces[_trans] {
+ case 0 :
+ if (i != 0) {
+ _cpc += 1;
+
+ }
+
+ break;
+ case 1 :
+ if (j != 0) {
+ _cpc += 1;
+
+ }
+
+ break;
+ case 2 :
+ if (k != 0) {
+ _cpc += 1;
+
+ }
+
+ break;
+ case 3 :
+ if (i != 0) {
+ _cpc += 1;
+
+ }
+ if (j != 0) {
+ _cpc += 2;
+
+ }
+
+ break;
+ case 4 :
+ if (j != 0) {
+ _cpc += 1;
+
+ }
+ if (k != 0) {
+ _cpc += 2;
+
+ }
+
+ break;
+ case 5 :
+ if (i != 0) {
+ _cpc += 1;
+
+ }
+ if (j != 0) {
+ _cpc += 2;
+
+ }
+ if (k != 0) {
+ _cpc += 4;
+
+ }
+
+ break;
+
+ }
+ {
+ var _lower int
+ var _mid int
+ var _upper int
+ _lower = _ckeys;
+ _upper = _ckeys + _klen - 1;
+ for _have == 0 && _lower <= _upper {
+ {
+ _mid = _lower + ((_upper-_lower) >> 1);
+ switch {
+ case _cpc < int(_foo_cond_keys[_mid ]):
+ _upper = _mid - 1;
+
+ case _cpc > int(_foo_cond_keys[_mid ]):
+ _lower = _mid + 1;
+
+ default:
+ {
+ _cond += uint((_mid - _ckeys));
+ _have = 1;
+ }
+
+ }
+ }
+
+ }
+ if _have == 0 {
+ {
+ cs = 0;
+ _cont = 0;
+ }
+
+ }
+ }
+ }
+
+ }
+ if _cont == 1 {
+ {
+ cs = int(_foo_cond_targs[_cond]);
+ switch _foo_cond_actions[_cond] {
+ case 8 :
+ {fmt.Print( " one\n" );}
+
+ break;
+ case 4 :
+ {fmt.Print( " two\n" );}
+
+ break;
+ case 6 :
+ {fmt.Print( " three\n" );}
+
+ break;
+ case 1 :
+ {if ( (( data[p ])) == 48 ) {
+ i = 0;
+
+ } else {
+ i = 1;
+
+ }
+ }
+
+ break;
+ case 2 :
+ {if ( (( data[p ])) == 48 ) {
+ j = 0;
+
+ } else {
+ j = 1;
+
+ }
+ }
+
+ break;
+ case 3 :
+ {if ( (( data[p ])) == 48 ) {
+ k = 0;
+
+ } else {
+ k = 1;
+
+ }
+ }
+
+ break;
+ case 5 :
+ {{p+= 1;
+ _cont = 0;
+ }
+ }
+
+ break;
+ case 9 :
+ {fmt.Print( " one\n" );}
+ {fmt.Print( " two\n" );}
+
+ break;
+ case 10 :
+ {fmt.Print( " one\n" );}
+ {fmt.Print( " three\n" );}
+
+ break;
+ case 7 :
+ {fmt.Print( " two\n" );}
+ {fmt.Print( " three\n" );}
+
+ break;
+ case 11 :
+ {fmt.Print( " one\n" );}
+ {fmt.Print( " two\n" );}
+ {fmt.Print( " three\n" );}
+
+ break;
+
+ }
+ if cs == 0 {
+ _cont = 0;
+
+ }
+ if _cont == 1 {
+ p += 1;
+
+ }
+ }
+ }
+ }
+
+ }
+ }
+
+ }
+ }
+}
+func finish() {
+ if cs >= foo_first_final {
+ fmt.Println("ACCEPT")
+ } else {
+ fmt.Println("FAIL")
+ }
+}
+var inp []string = []string {
+ "000abc\n",
+ "100abc\n",
+ "010abc\n",
+ "110abc\n",
+ "001abc\n",
+ "101abc\n",
+ "011abc\n",
+ "111abc\n",
+};
+
+func main() {
+ for _, data := range inp {
+ prepare()
+ exec(data)
+ finish()
+ }
+}