diff options
| author | Shinichiro Hamaji <shinichiro.hamaji _at_ gmail.com> | 2009-03-16 02:24:45 +0900 |
|---|---|---|
| committer | grischka <grischka> | 2009-04-18 15:07:09 +0200 |
| commit | 4f056031f4951dac5d6100dad7f5a1f023dcd273 (patch) | |
| tree | 1ee56bde63427d0f582b84c350d86981c0f4d2b8 /tcctest.c | |
| parent | 62e73da6124758c2e8c2a75defac2da092a93941 (diff) | |
| download | tinycc-4f056031f4951dac5d6100dad7f5a1f023dcd273.tar.gz tinycc-4f056031f4951dac5d6100dad7f5a1f023dcd273.tar.bz2 | |
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.
Diffstat (limited to 'tcctest.c')
| -rw-r--r-- | tcctest.c | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -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__ |
