* g++.dg/abi/offsetof.C (main): Use __SIZE_TYPE__ instead of
unsigned long for pointer cast.
* g++.dg/init/struct1.C: Likewise.
* g++.dg/init/struct2.C: Likewise.
* g++.dg/init/struct3.C: Likewise.
* g++.dg/ext/utf-cvt.C: Correct for w64.
* gcc.dg/utf-cvt.c: Likewise.
* lib/target-supports.exp (check_effective_target_llp64): New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@140807
138bc75d-0d04-0410-961f-
82ee72b054a4
+2008-10-01 Kai Tietz <kai.tietz@onevision.com>
+
+ * g++.dg/abi/offsetof.C (main): Use __SIZE_TYPE__ instead of
+ unsigned long for pointer cast.
+ * g++.dg/init/struct1.C: Likewise.
+ * g++.dg/init/struct2.C: Likewise.
+ * g++.dg/init/struct3.C: Likewise.
+ * g++.dg/ext/utf-cvt.C: Correct for w64.
+ * gcc.dg/utf-cvt.c: Likewise.
+ * lib/target-supports.exp (check_effective_target_llp64): New.
+
2008-09-30 Simon Martin <simartin@users.sourceforge.net>
PR c++/37555
int main ()
{
- return ((unsigned long) &((C*)0)->i) != sizeof(void*); // { dg-warning "offsetof|invalid" "" }
+ return ((__SIZE_TYPE__) &((C*)0)->i) != sizeof(void*); // { dg-warning "offsetof|invalid" "" }
}
f_i (c1); /* { dg-warning "change the sign" } */
fsi (c1); /* { dg-warning "change the sign" } */
fui (c1);
- f_l (c1); /* { dg-warning "change the sign" "" { target { ilp32 } } } */
- fsl (c1); /* { dg-warning "change the sign" "" { target { ilp32 } } } */
+ f_l (c1); /* { dg-warning "change the sign" "" { target { llp64 || ilp32 } } } */
+ fsl (c1); /* { dg-warning "change the sign" "" { target { llp64 || ilp32 } } } */
ful (c1);
f_ll (c1);
fsll (c1);
struct bug {
const char *name;
- unsigned long type;
+ __SIZE_TYPE__ type;
};
-struct bug s = { 0, (unsigned long) &s | 1 };
+struct bug s = { 0, (__SIZE_TYPE__) &s | 1 };
};
SaveLoadEntry trackEntries = {
- ((long) (&((Track *) 42)->soundName[0])) - 42,
+ ((long) (__SIZE_TYPE__) (&((Track *) 42)->soundName[0])) - 42,
0, 1
};
saveLoadEntries(&trackEntries);
int size;
};
-int foobar = ((long) (& ((Track *) 42)->soundName[0])) - 42;
+int foobar = ((long) (__SIZE_TYPE__) (& ((Track *) 42)->soundName[0])) - 42;
f_i (c1); /* { dg-warning "change the sign" } */
fsi (c1); /* { dg-warning "change the sign" } */
fui (c1);
- f_l (c1); /* { dg-warning "change the sign" "" { target { ilp32 } } } */
- fsl (c1); /* { dg-warning "change the sign" "" { target { ilp32 } } } */
+ f_l (c1); /* { dg-warning "change the sign" "" { target { llp64 || ilp32 } } } */
+ fsl (c1); /* { dg-warning "change the sign" "" { target { llp64 || ilp32 } } } */
ful (c1);
f_ll (c1);
fsll (c1);
}]
}
+# Return 1 if we're generating 64-bit code using default llp64 options,
+# 0 otherwise.
+
+proc check_effective_target_llp64 { } {
+ return [check_no_compiler_messages llp64 object {
+ int dummy[sizeof (int) == 4
+ && sizeof (void *) == 8
+ && sizeof (long long) == 8
+ && sizeof (long) == 4 ? 1 : -1];
+ }]
+}
+
# Return 1 if the target supports long double larger than double,
# 0 otherwise.