History

more long long tests - more ## tests

bellard committed 24 years ago

Commit 973eb601 parent 05a919e1 file · +28 −5Browse files

Unified · Split

tcctest.c+28−5
@@ -102,7 +102,10 @@ int isid(int c); · 101 unmodified lines
102102 #define B3 4
103103 #endif
104104
105−void macro_test()
105+#define __INT64_C(c) c ## LL
106+#define INT64_MIN (-__INT64_C(9223372036854775807)-1)
107+
108+void macro_test(void)
106109 {
107110 printf("macro:\n");
108111 pf("N=%d\n", N);
@@ -189,7 +192,7 @@ void macro_test() · 80 unmodified lines
189192 #line 203 "test"
190193 printf("__LINE__=%d __FILE__=%s\n",
191194 __LINE__, __FILE__);
192−#line 185 "tcctest.c"
195+#line 195 "tcctest.c"
193196
194197 /* not strictly preprocessor, but we test it there */
195198 #ifdef C99_MACROS
@@ -202,6 +205,9 @@ void macro_test() · 6 unmodified lines
202205
203206 /* gcc extension */
204207 printf("func='%s'\n", __FUNCTION__);
208+
209+ /* complicated macros in glibc */
210+ printf("INT64_MIN=%Ld\n", INT64_MIN);
205211 }
206212
207213 int op(a,b)
@@ -1352,10 +1358,19 @@ void llfloat(void) · 1144 unmodified lines
13521358
13531359 long long llfunc1(int a)
13541360 {
1355− return a;
1361+ return a * 2;
1362+}
1363+
1364+struct S {
1365+ int id;
1366+ char item;
1367+};
1368+
1369+long long int value(struct S *v)
1370+{
1371+ return ((long long int)v->item);
13561372 }
13571373
1358−/* currently not supported, except for typing */
13591374 void longlong_test(void)
13601375 {
13611376 long long a, b, c;
@@ -1382,7 +1397,7 @@ void longlong_test(void) · 20 unmodified lines
13821397 lloptest(-3, b);
13831398 llshift(0x123, 5);
13841399 llshift(-23, 5);
1385− b = 0x72345678 << 10;
1400+ b = 0x72345678LL << 10;
13861401 llshift(b, 47);
13871402
13881403 llfloat();
@@ -1392,6 +1407,14 @@ void longlong_test(void) · 3 unmodified lines
13921407 c = a + b;
13931408 printf("%Lx\n", c);
13941409 #endif
1410+
1411+ /* long long reg spill test */
1412+ {
1413+ struct S a;
1414+
1415+ a.item = 3;
1416+ printf("%lld\n", value(&a));
1417+ }
13951418 }
13961419
13971420 void vprintf1(const char *fmt, ...)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t