Commit 8d774623 by Ozkan Sezer Committed by Janis Johnson

991014-1.c: Use __SIZE_TYPE__ for size types.

2010-02-22  Ozkan Sezer  <sezeroz@gmail.com>

	* gcc.c-torture/execute/991014-1.c: Use __SIZE_TYPE__ for size types.

From-SVN: r156974
parent 26504a0f
2010-02-22 Ozkan Sezer <sezeroz@gmail.com>
* gcc.c-torture/execute/991014-1.c: Use __SIZE_TYPE__ for size types.
2010-02-22 Richard Guenther <rguenther@suse.de> 2010-02-22 Richard Guenther <rguenther@suse.de>
PR lto/43045 PR lto/43045
......
typedef typeof(sizeof(char)) Size_t; typedef __SIZE_TYPE__ Size_t;
#if __SIZEOF_LONG__ < __SIZEOF_POINTER__
#define bufsize ((1LL << (8 * sizeof(Size_t) - 2))-256)
#else
#define bufsize ((1L << (8 * sizeof(Size_t) - 2))-256) #define bufsize ((1L << (8 * sizeof(Size_t) - 2))-256)
#endif
struct huge_struct struct huge_struct
{ {
...@@ -18,19 +22,19 @@ union huge_union ...@@ -18,19 +22,19 @@ union huge_union
char buf[bufsize]; char buf[bufsize];
}; };
unsigned long union_size() Size_t union_size()
{ {
return sizeof(union huge_union); return sizeof(union huge_union);
} }
unsigned long struct_size() Size_t struct_size()
{ {
return sizeof(struct huge_struct); return sizeof(struct huge_struct);
} }
unsigned long struct_a_offset() Size_t struct_a_offset()
{ {
return (unsigned long)(&((struct huge_struct *) 0)->a); return (Size_t)(&((struct huge_struct *) 0)->a);
} }
int main() int main()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment