OSDN Git Service

2008-10-01 Kai Tietz <kai.tietz@onevision.com>
authorktietz <ktietz@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 1 Oct 2008 07:38:53 +0000 (07:38 +0000)
committerktietz <ktietz@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 1 Oct 2008 07:38:53 +0000 (07:38 +0000)
        * 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

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/abi/offsetof.C
gcc/testsuite/g++.dg/ext/utf-cvt.C
gcc/testsuite/g++.dg/init/struct1.C
gcc/testsuite/g++.dg/init/struct2.C
gcc/testsuite/g++.dg/init/struct3.C
gcc/testsuite/gcc.dg/utf-cvt.c
gcc/testsuite/lib/target-supports.exp

index b027a4c..755a970 100644 (file)
@@ -1,3 +1,14 @@
+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
index 0085e57..d6a53e6 100644 (file)
@@ -18,5 +18,5 @@ struct C: public B { };
 
 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" "" }
 }
index 3ebc3a1..286a0d0 100644 (file)
@@ -46,8 +46,8 @@ void m(char16_t c0, char32_t c1)
     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);
index 4cabc99..e23faef 100644 (file)
@@ -1,6 +1,6 @@
 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 };
index d7d07b5..85aacc6 100644 (file)
@@ -15,7 +15,7 @@ void saveOrLoad() {
     };    
 
     SaveLoadEntry trackEntries = {
-       ((long) (&((Track *) 42)->soundName[0])) - 42,
+       ((long) (__SIZE_TYPE__) (&((Track *) 42)->soundName[0])) - 42,
         0, 1
     };
     saveLoadEntries(&trackEntries);
index 6b1805c..53804b3 100644 (file)
@@ -12,4 +12,4 @@ struct SaveLoadEntry {
   int size;
 };    
 
-int foobar = ((long) (& ((Track *) 42)->soundName[0])) - 42;
+int foobar = ((long) (__SIZE_TYPE__) (& ((Track *) 42)->soundName[0])) - 42;
index 5c39644..6a69310 100644 (file)
@@ -50,8 +50,8 @@ void m (char16_t c0, char32_t c1)
     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);
index a5e03bf..3d118af 100644 (file)
@@ -1057,6 +1057,18 @@ proc check_effective_target_lp64 { } {
     }]
 }
 
+# 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.