• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*=============================================================================
2     Boost.Wave: A Standard compliant C++ preprocessor library
3     http://www.boost.org/
4 
5     Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost
6     Software License, Version 1.0. (See accompanying file
7     LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
8 
9     The tests included in this file were initially taken from the mcpp V2.5
10     preprocessor validation suite and were modified to fit into the Boost.Wave
11     unit test requirements.
12     The original files of the mcpp preprocessor are distributed under the
13     license reproduced at the end of this file.
14 =============================================================================*/
15 
16 // Tests integer preprocessing number token and type of #if expression.
17 
18 //O --long_long
19 
20 // 12.1:
21 //R #line 26 "t_5_014.cpp"
22 //R true
23 #if __TESTWAVE_LONG_MAX__ <= __TESTWAVE_LONG_MIN__
24     "Bad evaluation of long."
25 #else
26 true
27 #endif
28 
29 //R #line 34 "t_5_014.cpp"
30 //R true
31 #if __TESTWAVE_LONG_MAX__ <= (__TESTWAVE_LONG_MAX__ / 2)  /* 0x3FFFFFFF   */
32     "Bad evaluation of long."
33 #else
34 true
35 #endif
36 
37 // 12.2:
38 //R #line 43 "t_5_014.cpp"
39 //R true
40 #if __TESTWAVE_ULONG_MAX__ / 2 < __TESTWAVE_LONG_MAX__
41     "Bad evaluation of unsigned long."
42 #else
43 true
44 #endif
45 
46 // 12.3: Octal number.
47 //R #line 52 "t_5_014.cpp"
48 //R true
49 #if 0177777 != 65535
50     "Bad evaluation of octal number."
51 #else
52 true
53 #endif
54 
55 // 12.4: Hexadecimal number.
56 //R #line 61 "t_5_014.cpp"
57 //R true
58 #if 0Xffff != 65535 || 0xFfFf != 65535
59     "Bad evaluation of hexadecimal number."
60 #else
61 true
62 #endif
63 
64 // 12.5: Suffix 'L' or 'l'.
65 //R #line 70 "t_5_014.cpp"
66 //R true
67 #if 0L != 0 || 0l != 0
68     "Bad evaluation of 'L' suffix."
69 #else
70 true
71 #endif
72 
73 // 12.6: Suffix 'U' or 'u'.
74 //R #line 79 "t_5_014.cpp"
75 //R true
76 #if 1U != 1 || 1u != 1
77     "Bad evaluation of 'U' suffix."
78 #else
79 true
80 #endif
81 
82 // 12.7: Negative integer.
83 //R #line 88 "t_5_014.cpp"
84 //R true
85 #if 0 <= -1
86     "Bad evaluation of negative number."
87 #else
88 true
89 #endif
90 
91 // 12.8: Long Long integers
92 //R #line 97 "t_5_014.cpp"
93 //R true
94 #if 0LL != 0 || 0ll != 0
95     "Bad evaluation of 'LL' suffix."
96 #else
97 true
98 #endif
99 
100 // 12.8: Unsigned Long Long integers
101 //R #line 106 "t_5_014.cpp"
102 //R true
103 #if 1ull != 1 || 1uLL != 1 || 1Ull != 1 || 1ULL != 1 || 1llu != 1 || 1llU != 1 || 1LLu != 1 || 1LLU != 1
104     "Bad evaluation of 'ULL' or 'LLU' suffix."
105 #else
106 true
107 #endif
108 
109 // 12.9: invalid (mixed case) long long integers
110 //R #line 115 "t_5_014.cpp"
111 //R long long foo = 1234l L;
112 //R long long bar = 5678L l;
113 //R unsigned long long baz = 1234uL l;
114 //R unsigned long long quux = 5678uL l;
115 long long foo = 1234lL;
116 long long bar = 5678Ll;
117 unsigned long long baz = 1234uLl;
118 unsigned long long quux = 5678uLl;
119 
120 
121 /*-
122  * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp>
123  * All rights reserved.
124  *
125  * Redistribution and use in source and binary forms, with or without
126  * modification, are permitted provided that the following conditions
127  * are met:
128  * 1. Redistributions of source code must retain the above copyright
129  *    notice, this list of conditions and the following disclaimer.
130  * 2. Redistributions in binary form must reproduce the above copyright
131  *    notice, this list of conditions and the following disclaimer in the
132  *    documentation and/or other materials provided with the distribution.
133  *
134  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND
135  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
136  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
137  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE
138  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
139  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
140  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
141  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
142  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
143  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
144  * SUCH DAMAGE.
145  */
146 
147