GCC Bugzilla – Attachment 10333 Details for
Bug 25019
Promoting long to long long generates no warning and/or incorrect result.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
Test case for 32-64 bit promotion bug
32-64bug.c (text/plain), 1.17 KB, created by
Christian van den Bosch
on 2005-11-24 15:21:40 UTC
(
hide
)
Description:
Test case for 32-64 bit promotion bug
Filename:
MIME Type:
Creator:
Christian van den Bosch
Created:
2005-11-24 15:21:40 UTC
Size:
1.17 KB
patch
obsolete
>#include <stdio.h> >// most recent version of this code can be obtained at >// http://cjb.ie/32-64bug.c or http://cjb.ie/32-64bug.c.txt > >int main ( int argc, char *argv[] ) >{ long long a; > int b=40; > printf( " 550000000000 expected for 85LL<<40,\n%16llx obtained.\n", 85LL<<40 ); > printf( " 10000000000 expected for 1<<40 (const expr as printf arg),\n%16llx obtained.\n", 1<<40 ); > a=1<<40; > printf( " 10000000000 expected for 1<<40 (const expr, precomputed),\n%16llx obtained.\n", a ); > printf( "\n" ); > > printf( " 5500000000000 expected for 85LL<<44,\n%16llx obtained.\n", 85LL<<44 ); > a=1<<b; > printf( " 10000000000 expected for 1<<40 (variable expr, precomputed),\n%16llx obtained.\n", a ); > printf( " 10000000000 expected for 1<<40 (variable expr, as printf arg),\n%16llx obtained.\n", 1<<b ); > printf( "\n" ); > > printf( " 55000000000000 expected for 85LL<<48,\n%16llx obtained.\n", 85LL<<48 ); > printf( " 1234567800 expected for 0x12345678<<8 (const expr, as printf arg),\n%16llx obtained.\n", 0x12345678<<8 ); > a=0x12345678<<8; > printf( " 1234567800 expected for 0x12345678<<8 (const expr, precomputed),\n%16llx obtained.\n", a ); > printf( "\n" ); > >} > >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 25019
: 10333