OSDN Git Service

* gcc.dg/pack-test-5.c: Add -mno-ms-bitfields option
authorktietz <ktietz@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 23 Feb 2012 18:10:53 +0000 (18:10 +0000)
committerktietz <ktietz@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 23 Feb 2012 18:10:53 +0000 (18:10 +0000)
for mingw-targets.
* gcc.dg/Wpadded.c: Likewise.
* gcc.dg/bf-ms-layout-2.c: Adjust offsets to fit ms-bitfield
structure-layout.
* gcc.dg/di-sync-multithread.c: Replace for mingw-target the use
for sleep by Sleep and add windows.h include for this function.
* gcc.dg/format/dfp-printf-1.c: Adjust dg-skip-if rule for mingw
targets.
* gcc.dg/stack-usage-1.c (SIZE): Provide proper SIZE for x64 mingw
target.
* gcc.dg/tls/thr-cse-1.c: Provide proper pattern for x64 mingw
target.
* gcc.dg/tls/opt-11.c (memset): Use __extension__ to avoid fail
on x64 mingw target.
* gcc.dg/bf-ms-attrib.c: Adjust expected size for ms_struct layout.
* gcc.dg/pr50251.c: Disable test for x64 mingw target.
* gcc.c-torture/execute/930930-1.c (long): Replace by ptr_t to avoid
failure on LLP64 target.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@184519 138bc75d-0d04-0410-961f-82ee72b054a4

13 files changed:
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/execute/930930-1.c
gcc/testsuite/gcc.dg/Wpadded.c
gcc/testsuite/gcc.dg/bf-ms-attrib.c
gcc/testsuite/gcc.dg/bf-ms-layout-2.c
gcc/testsuite/gcc.dg/di-sync-multithread.c
gcc/testsuite/gcc.dg/format/dfp-printf-1.c
gcc/testsuite/gcc.dg/pack-test-5.c
gcc/testsuite/gcc.dg/pr49544.c
gcc/testsuite/gcc.dg/pr50251.c
gcc/testsuite/gcc.dg/stack-usage-1.c
gcc/testsuite/gcc.dg/tls/opt-11.c
gcc/testsuite/gcc.dg/tls/thr-cse-1.c

index a3513e9..b9eee49 100644 (file)
@@ -1,3 +1,25 @@
+2012-02-23  Kai Tietz  <ktietz@redhat.com>
+
+       * gcc.dg/pack-test-5.c: Add -mno-ms-bitfields option
+       for mingw-targets.
+       * gcc.dg/Wpadded.c: Likewise.
+       * gcc.dg/bf-ms-layout-2.c: Adjust offsets to fit ms-bitfield
+       structure-layout.
+       * gcc.dg/di-sync-multithread.c: Replace for mingw-target the use
+       for sleep by Sleep and add windows.h include for this function.
+       * gcc.dg/format/dfp-printf-1.c: Adjust dg-skip-if rule for mingw
+       targets.
+       * gcc.dg/stack-usage-1.c (SIZE): Provide proper SIZE for x64 mingw
+       target.
+       * gcc.dg/tls/thr-cse-1.c: Provide proper pattern for x64 mingw
+       target.
+       * gcc.dg/tls/opt-11.c (memset): Use __extension__ to avoid fail
+       on x64 mingw target.
+       * gcc.dg/bf-ms-attrib.c: Adjust expected size for ms_struct layout.
+       * gcc.dg/pr50251.c: Disable test for x64 mingw target.
+       * gcc.c-torture/execute/930930-1.c (long): Replace by ptr_t to avoid
+       failure on LLP64 target.
+
 2012-02-23  Uros Bizjak  <ubizjak@gmail.com>
 
        PR c/52290
 2012-02-23  Uros Bizjak  <ubizjak@gmail.com>
 
        PR c/52290
index 68fdbbf..101a5f9 100644 (file)
@@ -1,23 +1,24 @@
-long *wm_TR;
-long *wm_HB;
-long *wm_SPB;
+__extension__ typedef __PTRDIFF_TYPE__ ptr_t;
+ptr_t *wm_TR;
+ptr_t *wm_HB;
+ptr_t *wm_SPB;
 
 
-long mem[100];
+ptr_t mem[100];
 
 f (mr_TR, mr_SPB, mr_HB, reg1, reg2)
 
 f (mr_TR, mr_SPB, mr_HB, reg1, reg2)
-     long *mr_TR;
-     long *mr_SPB;
-     long *mr_HB;
-     long *reg1;
-     long *reg2;
+     ptr_t *mr_TR;
+     ptr_t *mr_SPB;
+     ptr_t *mr_HB;
+     ptr_t *reg1;
+     ptr_t *reg2;
 {
 {
-  long *x = mr_TR;
+  ptr_t *x = mr_TR;
 
   for (;;)
     {
       if (reg1 < reg2)
        goto out;
 
   for (;;)
     {
       if (reg1 < reg2)
        goto out;
-      if ((long *) *reg1 < mr_HB && (long *) *reg1 >= mr_SPB)
+      if ((ptr_t *) *reg1 < mr_HB && (ptr_t *) *reg1 >= mr_SPB)
        *--mr_TR = *reg1;
       reg1--;
     }
        *--mr_TR = *reg1;
       reg1--;
     }
@@ -29,7 +30,7 @@ f (mr_TR, mr_SPB, mr_HB, reg1, reg2)
 
 main ()
 {
 
 main ()
 {
-  mem[99] = (long) mem;
+  mem[99] = (ptr_t) mem;
   f (mem + 100, mem + 6, mem + 8, mem + 99, mem + 99);
   exit (0);
 }
   f (mem + 100, mem + 6, mem + 8, mem + 99, mem + 99);
   exit (0);
 }
index 9e69a9f..70fcd79 100644 (file)
@@ -6,6 +6,7 @@
    We won't get a warning anyway if the target has "packed" structure
    layout.  */
 /* { dg-options "-Wpadded -fpack-struct=8" } */
    We won't get a warning anyway if the target has "packed" structure
    layout.  */
 /* { dg-options "-Wpadded -fpack-struct=8" } */
+/* { dg-additional-options "-mno-ms-bitfields" { target *-*-mingw* } } */
 
 struct foo {
   char bar;
 
 struct foo {
   char bar;
index da4eb08..d62da2a 100644 (file)
@@ -32,7 +32,7 @@ main()
     /* As long as the sizes are as expected, we know attributes are working.
        bf-ms-layout.c makes sure the right thing happens when the attribute
        is on. */
     /* As long as the sizes are as expected, we know attributes are working.
        bf-ms-layout.c makes sure the right thing happens when the attribute
        is on. */
-    if (sizeof(struct one_ms) != 12)
+    if (sizeof(struct one_ms) != 8)
        abort();
     if (sizeof(struct one_gcc) != 8)
        abort();
        abort();
     if (sizeof(struct one_gcc) != 8)
        abort();
index 0bd472b..408ddbe 100644 (file)
@@ -158,27 +158,27 @@ int main(){
   struct ten test_ten;
 
 #if defined (_TEST_MS_LAYOUT) || defined (_MSC_VER)
   struct ten test_ten;
 
 #if defined (_TEST_MS_LAYOUT) || defined (_MSC_VER)
-  size_t exp_sizeof_one = 12;
-  size_t exp_sizeof_two = 16;
+  size_t exp_sizeof_one = 8;
+  size_t exp_sizeof_two = 12;
   size_t exp_sizeof_three =6;
   size_t exp_sizeof_four = 8;
   size_t exp_sizeof_five = 3;
   size_t exp_sizeof_six = 8;
   size_t exp_sizeof_seven = 3;
   size_t exp_sizeof_three =6;
   size_t exp_sizeof_four = 8;
   size_t exp_sizeof_five = 3;
   size_t exp_sizeof_six = 8;
   size_t exp_sizeof_seven = 3;
-  size_t exp_sizeof_eight = 4;
+  size_t exp_sizeof_eight = 2;
   size_t exp_sizeof_nine = 8;
   size_t exp_sizeof_nine = 8;
-  size_t exp_sizeof_ten = 16;
+  size_t exp_sizeof_ten = 8;
 
 
-  unsigned char exp_one_c = 8;
-  unsigned char exp_two_c  = 12;
+  unsigned char exp_one_c = 7;
+  unsigned char exp_two_c  = 9;
   unsigned char exp_three_c = 4;
   unsigned char exp_four_c = 4;
   char exp_five_c = 2;
   char exp_six_c = 5;
   char exp_seven_c = 2;
   unsigned char exp_three_c = 4;
   unsigned char exp_four_c = 4;
   char exp_five_c = 2;
   char exp_six_c = 5;
   char exp_seven_c = 2;
-  char exp_eight_c = 2;
+  char exp_eight_c = 1;
   char exp_nine_c = 0;
   char exp_nine_c = 0;
-  char exp_ten_c = 8;
+  char exp_ten_c = 1;
 
 #else /* testing -mno-ms-bitfields */
 
 
 #else /* testing -mno-ms-bitfields */
 
index 307ebf8..c786ff1 100644 (file)
@@ -10,6 +10,9 @@
 
 #include <pthread.h>
 #include <unistd.h>
 
 #include <pthread.h>
 #include <unistd.h>
+#ifdef _WIN32
+#include <windows.h>
+#endif
 
 /*#define DEBUGIT 1 */
 
 
 /*#define DEBUGIT 1 */
 
@@ -175,7 +178,11 @@ main ()
        t, err);
   };
 
        t, err);
   };
 
+#ifdef _WIN32
+  Sleep (5000);
+#else
   sleep (5);
   sleep (5);
+#endif
 
   /* Stop please.  */
   __sync_lock_test_and_set (&doquit, 1ll);
 
   /* Stop please.  */
   __sync_lock_test_and_set (&doquit, 1ll);
index e92f161..4453ad1 100644 (file)
@@ -3,7 +3,7 @@
 /* { dg-do compile } */
 /* { dg-require-effective-target dfp } */
 /* { dg-options "-Wformat" } */
 /* { dg-do compile } */
 /* { dg-require-effective-target dfp } */
 /* { dg-options "-Wformat" } */
-/* { dg-skip-if "No scanf/printf dfp support" { *-*-mingw* } } */
+/* { dg-skip-if "No scanf/printf dfp support" { *-*-mingw* } { "*" } { "" } } */
 
 extern int printf (const char *restrict, ...);
 
 
 extern int printf (const char *restrict, ...);
 
index 7645043..3a52a00 100644 (file)
@@ -1,6 +1,7 @@
 /* PR c/11446: packed on a struct takes precedence over aligned on the type
    of a field.  */
 /* { dg-do run } */
 /* PR c/11446: packed on a struct takes precedence over aligned on the type
    of a field.  */
 /* { dg-do run } */
+/* { dg-additional-options "-mno-ms-bitfields" { target *-*-mingw* } } */
 
 extern void abort (void);
 
 
 extern void abort (void);
 
index 9e558da..52f79dd 100644 (file)
@@ -3,6 +3,8 @@
 /* { dg-options "-g -O2" } */
 /* { dg-require-effective-target ptr32plus } */
 
 /* { dg-options "-g -O2" } */
 /* { dg-require-effective-target ptr32plus } */
 
+__extension__ typedef __PTRDIFF_TYPE__ ptr_t;
+
 int baz (int, int, void *);
 
 static inline __attribute__ ((always_inline)) long
 int baz (int, int, void *);
 
 static inline __attribute__ ((always_inline)) long
@@ -16,5 +18,5 @@ foo (int x, int y, void *z)
 long
 bar (long x, long y, long z)
 {
 long
 bar (long x, long y, long z)
 {
-  return foo (x, y, (void *) z);
+  return foo (x, y, (void *) (ptr_t) z);
 }
 }
index 21ca185..f791aa8 100644 (file)
@@ -1,4 +1,4 @@
-/* { dg-do compile } */
+/* { dg-do compile { target { ! { x86_64-*-mingw* } } } } */
 /* { dg-options "-O2" } */
 /* { dg-additional-options "-mpreferred-stack-boundary=12" { target x86_64-*-* } } */
 
 /* { dg-options "-O2" } */
 /* { dg-additional-options "-mpreferred-stack-boundary=12" { target x86_64-*-* } } */
 
index 77dd038..c852f78 100644 (file)
 #if defined(__i386__)
 #  define SIZE 248
 #elif defined(__x86_64__)
 #if defined(__i386__)
 #  define SIZE 248
 #elif defined(__x86_64__)
-#  define SIZE 356
+#  ifndef _WIN64
+#    define SIZE 356
+#  else
+#    define SIZE (256 - 24)
+#  endif
 #elif defined (__sparc__)
 #  if defined (__arch64__)
 #    define SIZE 76
 #elif defined (__sparc__)
 #  if defined (__arch64__)
 #    define SIZE 76
index 0069c48..edfe16b 100644 (file)
@@ -2,8 +2,10 @@
 /* { dg-require-effective-target tls_runtime } */
 /* { dg-add-options tls } */
 
 /* { dg-require-effective-target tls_runtime } */
 /* { dg-add-options tls } */
 
+__extension__ typedef __SIZE_TYPE__ size_t;
+
 extern void abort (void);
 extern void abort (void);
-extern void *memset (void *, int, __SIZE_TYPE__);
+extern void *memset (void *, int, size_t);
 
 struct A
 {
 
 struct A
 {
index 87fdc64..8e64424 100644 (file)
@@ -18,10 +18,11 @@ int foo (int b, int c, int d)
   return a;
 }
 
   return a;
 }
 
-/* { dg-final { scan-assembler-not "emutls_get_address.*emutls_get_address.*" { target { ! { "*-wrs-vxworks"  "*-*-darwin8"  "hppa*-*-hpux*" "spu-*-*" "i?86-*-mingw*" } } } } } */
+/* { dg-final { scan-assembler-not "emutls_get_address.*emutls_get_address.*" { target { ! { "*-wrs-vxworks"  "*-*-darwin8"  "hppa*-*-hpux*" "spu-*-*" "i?86-*-mingw*" "x86_64-*-mingw*" } } } } } */
 /* { dg-final { scan-assembler-not "call\tL___emutls_get_address.stub.*call\tL___emutls_get_address.stub.*" { target "*-*-darwin8" } } } */
 /* { dg-final { scan-assembler-not "(b,l|bl) __emutls_get_address.*(b,l|bl) __emutls_get_address.*" { target "hppa*-*-hpux*" } } } */
 /* { dg-final { scan-assembler-not "(brsl|brasl)\t__emutls_get_address.*(brsl|brasl)\t__emutls_get_address.*" { target spu-*-* } } } */
 /* { dg-final { scan-assembler-not "tls_lookup.*tls_lookup.*" { target *-wrs-vxworks } } } */
 /* { dg-final { scan-assembler-not "call\t___emutls_get_address.*call\t___emutls_get_address" { target "i?86-*-mingw*" } } } */
 /* { dg-final { scan-assembler-not "call\tL___emutls_get_address.stub.*call\tL___emutls_get_address.stub.*" { target "*-*-darwin8" } } } */
 /* { dg-final { scan-assembler-not "(b,l|bl) __emutls_get_address.*(b,l|bl) __emutls_get_address.*" { target "hppa*-*-hpux*" } } } */
 /* { dg-final { scan-assembler-not "(brsl|brasl)\t__emutls_get_address.*(brsl|brasl)\t__emutls_get_address.*" { target spu-*-* } } } */
 /* { dg-final { scan-assembler-not "tls_lookup.*tls_lookup.*" { target *-wrs-vxworks } } } */
 /* { dg-final { scan-assembler-not "call\t___emutls_get_address.*call\t___emutls_get_address" { target "i?86-*-mingw*" } } } */
+/* { dg-final { scan-assembler-not "call\t__emutls_get_address.*call\t__emutls_get_address" { target "x86_64-*-mingw*" } } } */