From ca204053217b69ee1841fb01d51167c2c7a964bc Mon Sep 17 00:00:00 2001 From: Jade Alglave Date: Mon, 10 Jun 2024 12:45:09 +0100 Subject: [PATCH] naturally I forgot to update run.t --- asllib/tests/language.t/Rcgwr-3.asl | 17 +++++++++++++++++ asllib/tests/language.t/run.t | 29 ++++++++++++++++++++++++++++- 2 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 asllib/tests/language.t/Rcgwr-3.asl diff --git a/asllib/tests/language.t/Rcgwr-3.asl b/asllib/tests/language.t/Rcgwr-3.asl new file mode 100644 index 0000000000..3240868c9a --- /dev/null +++ b/asllib/tests/language.t/Rcgwr-3.asl @@ -0,0 +1,17 @@ +// RUN: interp %s | FileCheck %s +// RCGWR A tuple type must contain at least 2 elements. + +// This is expected to be a valid ASL specification. All tuples have at least 2 elements. +// see Rcgwr-2.asl for a negative test with tuples with 0 and 1 elements. + +type a_t of (integer, boolean); +type b_t of (integer, boolean, bits(32)); + + +func main() => b_t +begin + var a : a_t = (42, TRUE); + var b : b_t = (0, FALSE, Zeros(32)); + + return b; +end diff --git a/asllib/tests/language.t/run.t b/asllib/tests/language.t/run.t index f383695caa..ffc62f0746 100644 --- a/asllib/tests/language.t/run.t +++ b/asllib/tests/language.t/run.t @@ -261,6 +261,9 @@ Test Imqwb.asl: Test Rcgwr.asl: $ aslref Rcgwr.asl +Test Rcgwr-2.asl: + $ aslref Rcgwr-2.asl + Test Rjhkl.asl: $ aslref Rjhkl.asl File Rjhkl.asl, line 7, characters 4 to 5: @@ -1037,6 +1040,12 @@ Test Rksqp_c.asl: Test Rpnqj.asl: $ aslref Rpnqj.asl +Test Rpnqj-2.asl: + $ aslref Rpnqj-2.asl + File Rpnqj-2.asl, line 10, characters 8 to 24: + ASL Error: Undefined identifier: 'println' + [1] + Test Rsblx.asl: $ aslref Rsblx.asl @@ -1315,7 +1324,7 @@ Test Iqslr.asl: Test Ivgsp.asl: $ aslref Ivgsp.asl - File Ivgsp.asl, line 6, character 0 to line 9, character 3: + File Ivgsp.asl, line 9, character 0 to line 12, character 3: ASL Typing error: cannot declare already declared element "a". [1] @@ -1397,6 +1406,12 @@ For reference, the test writter intention was that this output matched: // CHECK: Hello // CHECK-NEXT: World +Test Rdgrv-2.asl: + $ aslref Rdgrv-2.asl + File Rdgrv-2.asl, line 47, characters 8 to 17: + ASL Error: Cannot parse. + [1] + Test Rgvcc.asl: $ aslref Rgvcc.asl Uncaught exception: a {} @@ -2933,6 +2948,12 @@ Test Ivgsp-2.asl: ASL Typing error: cannot declare already declared element "a". [1] +Test Ivgsp-3.asl: + $ aslref Ivgsp-3.asl + File Ivgsp-3.asl, line 9, characters 3 to 23: + ASL Typing error: a subtype of string was expected, provided integer. + [1] + Test Rccvd-2.asl: $ aslref Rccvd-2.asl @@ -3021,6 +3042,12 @@ Test Rqdqd-2.asl: ASL Error: Cannot parse. [1] +Test Rqdqd-3.asl: + $ aslref Rqdqd-3.asl + File Rqdqd-3.asl, line 8, characters 13 to 14: + ASL Error: Cannot parse. + [1] + Test Rvgzf-2.asl: $ aslref Rvgzf-2.asl