From 4f056031f4951dac5d6100dad7f5a1f023dcd273 Mon Sep 17 00:00:00 2001 From: Shinichiro Hamaji Date: Mon, 16 Mar 2009 02:24:45 +0900 Subject: Support long long bitfields for all architectures. - Modified gv() and vstore(), added vpushll(). - Added a test case for long long bitfields. - Tested on x86 and x86-64. --- tcctest.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'tcctest.c') diff --git a/tcctest.c b/tcctest.c index 050f522..012a51b 100644 --- a/tcctest.c +++ b/tcctest.c @@ -1375,6 +1375,21 @@ void bitfield_test(void) printf("st1.f2 == -1\n"); else printf("st1.f2 != -1\n"); + + /* bit sizes below must be bigger than 32 since GCC doesn't allow + long-long bitfields whose size is not bigger than int */ + struct sbf2 { + long long f1 : 45; + long long : 2; + long long f2 : 35; + unsigned long long f3 : 38; + } st2; + st2.f1 = 0x123456789ULL; + a = 120; + st2.f2 = (long long)a << 25; + st2.f3 = a; + st2.f2++; + printf("%lld %lld %lld\n", st2.f1, st2.f2, st2.f3); } #ifdef __x86_64__ -- cgit v1.3.1