From 63a39f5a2712391a8bd7174a5b23d0a8205997e6 Mon Sep 17 00:00:00 2001 From: Adam Sampson Date: Thu, 26 Apr 2007 16:06:45 +0000 Subject: [PATCH] More testcases --- fco2/testcases/_bad_string_cont.occ | 5 +++++ fco2/testcases/_bad_string_cont2.occ | 2 ++ fco2/testcases/indentation.occ | 31 ++++++++++++++++++++++++++++ fco2/testcases/multidim-literal.occ | 7 +++++++ fco2/testcases/pull-consts.occ | 14 +++++++++++++ 5 files changed, 59 insertions(+) create mode 100644 fco2/testcases/_bad_string_cont.occ create mode 100644 fco2/testcases/_bad_string_cont2.occ create mode 100644 fco2/testcases/indentation.occ create mode 100644 fco2/testcases/multidim-literal.occ create mode 100644 fco2/testcases/pull-consts.occ diff --git a/fco2/testcases/_bad_string_cont.occ b/fco2/testcases/_bad_string_cont.occ new file mode 100644 index 0000000..8fc1c50 --- /dev/null +++ b/fco2/testcases/_bad_string_cont.occ @@ -0,0 +1,5 @@ +PROC P () + VAL []BYTE s IS "hello * + not a star": + SKIP +: diff --git a/fco2/testcases/_bad_string_cont2.occ b/fco2/testcases/_bad_string_cont2.occ new file mode 100644 index 0000000..e15d373 --- /dev/null +++ b/fco2/testcases/_bad_string_cont2.occ @@ -0,0 +1,2 @@ +PROC P () + VAL []BYTE s IS "hello * diff --git a/fco2/testcases/indentation.occ b/fco2/testcases/indentation.occ new file mode 100644 index 0000000..b51c40a --- /dev/null +++ b/fco2/testcases/indentation.occ @@ -0,0 +1,31 @@ +-- Comment here +PROC P () -- more commentry + INT x: + INT y: + VAL []BYTE s IS "hello, world!": + VAL []BYTE not.comment IS "string -- with dashes -- here!": + VAL []BYTE one.cont IS "one string cont line * + *continued here.": + VAL []BYTE two.cont IS "two string cont lines * + *continued here... * + *and also here!": + SEQ + x := 42 --comment! + y := x + 22 + y := x + + 22 + y := +x + x, + y := + y, + x + IF + (x = + 2) AND + (y = + 42) + STOP + TRUE + SKIP +: diff --git a/fco2/testcases/multidim-literal.occ b/fco2/testcases/multidim-literal.occ new file mode 100644 index 0000000..71fcf6b --- /dev/null +++ b/fco2/testcases/multidim-literal.occ @@ -0,0 +1,7 @@ +PROC P () + VAL [2][2]INT is IS + [[1, 2], + [3, 4]]: + INT x: + x := is[1][1] +: diff --git a/fco2/testcases/pull-consts.occ b/fco2/testcases/pull-consts.occ new file mode 100644 index 0000000..8a21469 --- /dev/null +++ b/fco2/testcases/pull-consts.occ @@ -0,0 +1,14 @@ +VAL INT table.x IS 36: +VAL INT table.y IS 14: +VAL []INT forks.x IS [2, 3, 8, 9, 5]: +VAL []INT forks.y IS [3, 1, 1, 3, 4]: +VAL []INT phils.x IS [-2, -2, 4, 12, 9]: +VAL []INT phils.y IS [4, -1, -3, 1, 5]: + +PROC main () + INT x: + SEQ + x := table.x + x := forks.x[0] + forks.y[0] + x := phils.x[0] + phils.y[0] +: