From a22cd10d1a803b7175bd95c930cc064dcab13910 Mon Sep 17 00:00:00 2001 From: Jens-Heiner Rechtien Date: Tue, 20 Jun 2006 02:52:24 +0000 Subject: [PATCH] INTEGRATION: CWS warnings01 (1.3.14); FILE MERGED 2005/09/23 00:09:22 sb 1.3.14.2: RESYNC: (1.3-1.4); FILE MERGED 2005/09/13 13:29:04 sb 1.3.14.1: #i53898# Fixed handling of integral literals. --- idlc/test/parser/constant.tests | 216 +++++++++++++++++++++++++++++++- 1 file changed, 214 insertions(+), 2 deletions(-) diff --git a/idlc/test/parser/constant.tests b/idlc/test/parser/constant.tests index 3f0cdcf04882..b198d3547793 100644 --- a/idlc/test/parser/constant.tests +++ b/idlc/test/parser/constant.tests @@ -4,9 +4,9 @@ # # $RCSfile: constant.tests,v $ # -# $Revision: 1.4 $ +# $Revision: 1.5 $ # -# last change: $Author: rt $ $Date: 2005-09-07 18:17:17 $ +# last change: $Author: hr $ $Date: 2006-06-20 03:52:24 $ # # The Contents of this file are made available subject to # the terms of GNU Lesser General Public License Version 2.1. @@ -89,3 +89,215 @@ module m { EXPECT SUCCESS "constant.tests 7": constants C {}; + + +EXPECT SUCCESS "constant.tests 8": +module m { + const byte C1 = -128; + const byte C2 = -0200; + const byte C3 = -0x80; + const byte C4 = 255; + const byte C5 = 0377; + const byte C6 = 0xFF; + const short C7 = -32768; + const short C8 = -0100000; + const short C9 = -0x8000; + const short C10 = 32767; + const short C11 = 077777; + const short C12 = 0x7FFF; + const unsigned short C13 = 0; + const unsigned short C14 = 0x0; + const unsigned short C15 = 65535; + const unsigned short C16 = 0177777; + const unsigned short C17 = 0xFFFF; + const long C18 = -2147483648; + const long C19 = -020000000000; + const long C20 = -0x80000000; + const long C21 = 2147483647; + const long C22 = 017777777777; + const long C23 = 0x7FFFFFFF; + const unsigned long C24 = 0; + const unsigned long C25 = 0x0; + const unsigned long C26 = 4294967295; + const unsigned long C27 = 037777777777; + const unsigned long C28 = 0xFFFFFFFF; + const hyper C29 = -9223372036854775808; + const hyper C30 = -01000000000000000000000; + const hyper C31 = -0x8000000000000000; + const hyper C32 = 9223372036854775807; + const hyper C33 = 0777777777777777777777; + const hyper C34 = 0x7FFFFFFFFFFFFFFF; + const unsigned hyper C35 = 0; + const unsigned hyper C36 = 0x0; + const unsigned hyper C37 = 18446744073709551615; + const unsigned hyper C38 = 01777777777777777777777; + const unsigned hyper C39 = 0xFFFFFFFFFFFFFFFF; +}; + + +EXPECT FAILURE "constant.tests 9": +module m { const byte C = -129; }; + + +EXPECT FAILURE "constant.tests 10": +module m { const byte C = -0201; }; + + +EXPECT FAILURE "constant.tests 11": +module m { const byte C = -0x81; }; + + +EXPECT FAILURE "constant.tests 12": +module m { const byte C = 256; }; + + +EXPECT FAILURE "constant.tests 13": +module m { const byte C = 0400; }; + + +EXPECT FAILURE "constant.tests 14": +module m { const byte C = 0x100; }; + + +EXPECT FAILURE "constant.tests 15": +module m { const short C = -32769; }; + + +EXPECT FAILURE "constant.tests 16": +module m { const short C = -0100001; }; + + +EXPECT FAILURE "constant.tests 17": +module m { const short C = -0x8001; }; + + +EXPECT FAILURE "constant.tests 18": +module m { const short C = 32768; }; + + +EXPECT FAILURE "constant.tests 19": +module m { const short C = 0100000; }; + + +EXPECT FAILURE "constant.tests 20": +module m { const short C = 0x8000; }; + + +EXPECT FAILURE "constant.tests 21": +module m { const unsigned short C = -1; }; + + +EXPECT FAILURE "constant.tests 22": +module m { const unsigned short C = -01; }; + + +EXPECT FAILURE "constant.tests 23": +module m { const unsigned short C = -0x1; }; + + +EXPECT FAILURE "constant.tests 24": +module m { const unsigned short C = 65536; }; + + +EXPECT FAILURE "constant.tests 25": +module m { const unsigned short C = 0200000; }; + + +EXPECT FAILURE "constant.tests 26": +module m { const unsigned short C = 0x10000; }; + + +EXPECT FAILURE "constant.tests 27": +module m { const long C = -2147483649; }; + + +EXPECT FAILURE "constant.tests 28": +module m { const long C = -020000000001; }; + + +EXPECT FAILURE "constant.tests 29": +module m { const long C = -0x80000001; }; + + +EXPECT FAILURE "constant.tests 30": +module m { const long C = 2147483648; }; + + +EXPECT FAILURE "constant.tests 31": +module m { const long C = 020000000000; }; + + +EXPECT FAILURE "constant.tests 32": +module m { const long C = 0x80000000; }; + + +EXPECT FAILURE "constant.tests 33": +module m { const unsigned long C = -1; }; + + +EXPECT FAILURE "constant.tests 34": +module m { const unsigned long C = -01; }; + + +EXPECT FAILURE "constant.tests 35": +module m { const unsigned long C = -0x1; }; + + +EXPECT FAILURE "constant.tests 36": +module m { const unsigned long C = 4294967296; }; + + +EXPECT FAILURE "constant.tests 37": +module m { const unsigned long C = 040000000000; }; + + +EXPECT FAILURE "constant.tests 38": +module m { const unsigned long C = 0x100000000; }; + + +EXPECT FAILURE "constant.tests 39": +module m { const hyper C = -9223372036854775809; }; + + +EXPECT FAILURE "constant.tests 40": +module m { const hyper C = -01000000000000000000001; }; + + +EXPECT FAILURE "constant.tests 41": +module m { const hyper C = -0x8000000000000001; }; + + +EXPECT FAILURE "constant.tests 42": +module m { const hyper C = 9223372036854775808; }; + + +EXPECT FAILURE "constant.tests 43": +module m { const hyper C = 01000000000000000000000; }; + + +EXPECT FAILURE "constant.tests 44": +module m { const hyper C = 0x8000000000000000; }; + + +EXPECT FAILURE "constant.tests 45": +module m { const unsigned hyper C = -1; }; + + +EXPECT FAILURE "constant.tests 46": +module m { const unsigned hyper C = -01; }; + + +EXPECT FAILURE "constant.tests 47": +module m { const unsigned hyper C = -0x1; }; + + +EXPECT FAILURE "constant.tests 48": +module m { const unsigned hyper C = 18446744073709551616; }; + + +EXPECT FAILURE "constant.tests 49": +module m { const unsigned hyper C = 02000000000000000000000; }; + + +EXPECT FAILURE "constant.tests 50": +module m { const unsigned hyper C = 0x10000000000000000; };