From 97ff7dd6abf007f100c0b12c67702f98c45701c3 Mon Sep 17 00:00:00 2001 From: pacien Date: Tue, 5 Jun 2018 22:48:55 +0200 Subject: add const tests --- res/test_const_ko.tpc | 9 +++++++++ res/test_const_ok.tpc | 9 +++++++++ 2 files changed, 18 insertions(+) create mode 100644 res/test_const_ko.tpc create mode 100644 res/test_const_ok.tpc (limited to 'res') diff --git a/res/test_const_ko.tpc b/res/test_const_ko.tpc new file mode 100644 index 0000000..6683d01 --- /dev/null +++ b/res/test_const_ko.tpc @@ -0,0 +1,9 @@ +const c1 = 0; +const c2 = 0; + +entier main(void) { + entier c1; + c1 = 0; /* expect no error */ + c2 = 0; /* expect an error */ + return 1; +} diff --git a/res/test_const_ok.tpc b/res/test_const_ok.tpc new file mode 100644 index 0000000..caf647c --- /dev/null +++ b/res/test_const_ok.tpc @@ -0,0 +1,9 @@ +const c1 = 1; +const c2 = 2; + +entier main(void) { + const c2 = 3; + const c3 = 4; + print(c1 + c2 + c3); /* expect: 1+3+4 = 8 */ + return 0; +} -- cgit v1.2.3