aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/torture
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/torture')
-rw-r--r--gcc/testsuite/gcc.dg/torture/builtin-cproj-1.c1
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr16104-1.c14
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr35771-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr35771-2.c2
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr35771-3.c2
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr35771.h12
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr36891.c1
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr44695.c15
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr44806.c90
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr44977.c41
-rw-r--r--gcc/testsuite/gcc.dg/torture/stackalign/alloca-2.c12
-rw-r--r--gcc/testsuite/gcc.dg/torture/stackalign/alloca-3.c12
-rw-r--r--gcc/testsuite/gcc.dg/torture/stackalign/push-1.c17
-rw-r--r--gcc/testsuite/gcc.dg/torture/stackalign/vararg-3.c13
14 files changed, 165 insertions, 69 deletions
diff --git a/gcc/testsuite/gcc.dg/torture/builtin-cproj-1.c b/gcc/testsuite/gcc.dg/torture/builtin-cproj-1.c
index 31cd5874ffb..031a2fca0a9 100644
--- a/gcc/testsuite/gcc.dg/torture/builtin-cproj-1.c
+++ b/gcc/testsuite/gcc.dg/torture/builtin-cproj-1.c
@@ -6,6 +6,7 @@
Origin: Kaveh R. Ghazi, April 9, 2010. */
/* { dg-do link } */
+/* { dg-add-options ieee } */
/* All references to link_error should go away at compile-time. The
argument is the __LINE__ number. It appears in the tree dump file
diff --git a/gcc/testsuite/gcc.dg/torture/pr16104-1.c b/gcc/testsuite/gcc.dg/torture/pr16104-1.c
index 3eb405906a2..ad5eda65fca 100644
--- a/gcc/testsuite/gcc.dg/torture/pr16104-1.c
+++ b/gcc/testsuite/gcc.dg/torture/pr16104-1.c
@@ -1,9 +1,7 @@
/* PR rtl-optimization/16104 */
/* { dg-do run { target i?86-*-* x86_64-*-* } } */
/* { dg-options "-msse2" } */
-/* { dg-require-effective-target sse2 } */
-
-#include "cpuid.h"
+/* { dg-require-effective-target sse2_runtime } */
extern void abort (void);
@@ -76,14 +74,6 @@ do_test (void)
int
main (void)
{
- unsigned int eax, ebx, ecx, edx;
-
- if (!__get_cpuid (1, &eax, &ebx, &ecx, &edx))
- return 0;
-
- /* Run SSE2 test only if host has SSE2 support. */
- if (edx & bit_SSE2)
- do_test ();
-
+ do_test ();
return 0;
}
diff --git a/gcc/testsuite/gcc.dg/torture/pr35771-1.c b/gcc/testsuite/gcc.dg/torture/pr35771-1.c
index 8def464aa6d..b3fd554da22 100644
--- a/gcc/testsuite/gcc.dg/torture/pr35771-1.c
+++ b/gcc/testsuite/gcc.dg/torture/pr35771-1.c
@@ -1,6 +1,6 @@
/* { dg-do run { target i?86-*-* x86_64-*-* } } */
/* { dg-options "-msse2" } */
-/* { dg-require-effective-target sse2 } */
+/* { dg-require-effective-target sse2_runtime } */
typedef float __m128 __attribute__ ((__vector_size__ (16), __may_alias__));
diff --git a/gcc/testsuite/gcc.dg/torture/pr35771-2.c b/gcc/testsuite/gcc.dg/torture/pr35771-2.c
index 3d6add10de9..a033caefd5c 100644
--- a/gcc/testsuite/gcc.dg/torture/pr35771-2.c
+++ b/gcc/testsuite/gcc.dg/torture/pr35771-2.c
@@ -1,6 +1,6 @@
/* { dg-do run { target i?86-*-* x86_64-*-* } } */
/* { dg-options "-msse2" } */
-/* { dg-require-effective-target sse2 } */
+/* { dg-require-effective-target sse2_runtime } */
typedef double __m128d __attribute__ ((__vector_size__ (16), __may_alias__));
diff --git a/gcc/testsuite/gcc.dg/torture/pr35771-3.c b/gcc/testsuite/gcc.dg/torture/pr35771-3.c
index 9a69b21a511..fcbe86cb1ba 100644
--- a/gcc/testsuite/gcc.dg/torture/pr35771-3.c
+++ b/gcc/testsuite/gcc.dg/torture/pr35771-3.c
@@ -1,6 +1,6 @@
/* { dg-do run { target i?86-*-* x86_64-*-* } } */
/* { dg-options "-msse2" } */
-/* { dg-require-effective-target sse2 } */
+/* { dg-require-effective-target sse2_runtime } */
typedef long long __m128i __attribute__ ((__vector_size__ (16), __may_alias__));
diff --git a/gcc/testsuite/gcc.dg/torture/pr35771.h b/gcc/testsuite/gcc.dg/torture/pr35771.h
index 01c248751c1..7b921c41ba9 100644
--- a/gcc/testsuite/gcc.dg/torture/pr35771.h
+++ b/gcc/testsuite/gcc.dg/torture/pr35771.h
@@ -1,7 +1,5 @@
typedef TYPE __attribute__((aligned(1))) unaligned;
-#include "cpuid.h"
-
extern void abort (void);
@@ -27,14 +25,6 @@ do_test (void)
int
main (void)
{
- unsigned int eax, ebx, ecx, edx;
-
- if (!__get_cpuid (1, &eax, &ebx, &ecx, &edx))
- return 0;
-
- /* Run SSE2 test only if host has SSE2 support. */
- if (edx & bit_SSE2)
- do_test ();
-
+ do_test ();
return 0;
}
diff --git a/gcc/testsuite/gcc.dg/torture/pr36891.c b/gcc/testsuite/gcc.dg/torture/pr36891.c
index 31f7e173142..53e6163de14 100644
--- a/gcc/testsuite/gcc.dg/torture/pr36891.c
+++ b/gcc/testsuite/gcc.dg/torture/pr36891.c
@@ -1,6 +1,7 @@
/* { dg-do compile } */
/* { dg-options "-ffast-math" } */
/* { dg-options "-ffast-math -msse" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
+/* { dg-require-effective-target sse { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
#define __vector __attribute__((vector_size(16) ))
__vector float f(void);
diff --git a/gcc/testsuite/gcc.dg/torture/pr44695.c b/gcc/testsuite/gcc.dg/torture/pr44695.c
new file mode 100644
index 00000000000..85bb4c7b927
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr44695.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+
+typedef unsigned char uint8_t;
+
+static uint8_t
+safe_div_func_uint8_t_u_u (uint8_t ui1, uint8_t ui2)
+{
+ return ui2 ? ui2 : (ui1 / ui2);
+}
+
+int
+int81 (int x)
+{
+ return safe_div_func_uint8_t_u_u (1, 8 & x);
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pr44806.c b/gcc/testsuite/gcc.dg/torture/pr44806.c
new file mode 100644
index 00000000000..d0002d308d0
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr44806.c
@@ -0,0 +1,90 @@
+/* { dg-do run } */
+
+#include <stdint.h>
+
+extern void abort (void);
+
+#define N_DEV_BITS_4 5
+#define N_INO_BITS_4 (32 - N_DEV_BITS_4 - 2 - 1)
+
+#define N_DEV_BITS_8 8
+#define N_INO_BITS_8 (64 - N_DEV_BITS_8 - 2 - 1)
+
+struct dev_ino_4
+{
+ uint32_t mode:2;
+ uint32_t short_ino:N_INO_BITS_4;
+ uint32_t mapped_dev:N_DEV_BITS_4;
+ uint32_t always_set:1;
+};
+
+struct dev_ino_8
+{
+ uint32_t mode:2;
+ uint64_t short_ino:N_INO_BITS_8;
+ uint32_t mapped_dev:N_DEV_BITS_8;
+ uint32_t always_set:1;
+};
+
+struct dev_ino_full
+{
+ uint32_t mode:2;
+ uint32_t dev;
+ uint32_t ino;
+};
+
+enum di_mode
+{
+ DI_MODE_4 = 1,
+ DI_MODE_8 = 2,
+ DI_MODE_FULL = 3
+};
+
+struct di_ent
+{
+ union
+ {
+ struct dev_ino_4 di4;
+ struct dev_ino_8 di8;
+ struct dev_ino_full full;
+ uint32_t u32;
+ uint64_t u64;
+ void *ptr;
+ } u;
+};
+
+static struct di_ent
+decode_ptr (struct di_ent const *v)
+{
+ struct di_ent di;
+ di.u.ptr = (void *) v;
+ return di;
+}
+
+static int
+di_ent_equal (void const *x, void const *y)
+{
+ struct di_ent a = decode_ptr (x);
+ struct di_ent b = decode_ptr (y);
+ if (a.u.di4.mode != b.u.di4.mode)
+ return 0;
+
+ if (a.u.di4.mode == DI_MODE_4)
+ return (a.u.di4.short_ino == b.u.di4.short_ino
+ && a.u.di4.mapped_dev == b.u.di4.mapped_dev);
+
+ if (a.u.di8.mode == DI_MODE_8)
+ return (a.u.di8.short_ino == b.u.di8.short_ino
+ && a.u.di8.mapped_dev == b.u.di8.mapped_dev);
+
+ return (a.u.full.ino == b.u.full.ino
+ && a.u.full.dev == b.u.full.dev);
+}
+
+int
+main ()
+{
+ if (di_ent_equal ((void *) 0x80143c4d, (void *) 0x80173851) != 0)
+ abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pr44977.c b/gcc/testsuite/gcc.dg/torture/pr44977.c
new file mode 100644
index 00000000000..66fd7d1bfae
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr44977.c
@@ -0,0 +1,41 @@
+/* { dg-do compile } */
+/* { dg-options "-w" } */
+
+static unsigned short
+foo (unsigned short ui1, unsigned short ui2)
+{
+ return ui1 - ui2;
+}
+
+static unsigned short
+bar (unsigned ui1, unsigned short ui2)
+{
+ return ui1 + ui2;
+}
+
+struct S1
+{
+ const short f3;
+};
+int g_31;
+short g_67;
+struct S1 g_68[2][5][9][1][1] = {
+};
+
+int func_90 (int);
+
+int int329 (int * const *const int32p_81, short ** p_82)
+{
+ short l_169[8];
+ for (g_31 = 0; g_31 <= 0; g_31 = foo (g_31, 1))
+ {
+ short l_85;
+lbl_89:g_67 ^= l_85;
+ for (l_85 = 0; l_85 >= 0; l_85 = bar)
+ if (g_31)
+ goto lbl_89;
+ func_90 (1), g_68[0][2][2][0][0].f3, 0;
+ }
+ return l_169[6];
+}
+
diff --git a/gcc/testsuite/gcc.dg/torture/stackalign/alloca-2.c b/gcc/testsuite/gcc.dg/torture/stackalign/alloca-2.c
index cbbb9d03a4c..139b74ed9c6 100644
--- a/gcc/testsuite/gcc.dg/torture/stackalign/alloca-2.c
+++ b/gcc/testsuite/gcc.dg/torture/stackalign/alloca-2.c
@@ -1,10 +1,9 @@
/* PR middle-end/37009 */
/* { dg-do run { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
/* { dg-options "-msse2" } */
-/* { dg-require-effective-target sse2 } */
+/* { dg-require-effective-target sse2_runtime } */
#include <emmintrin.h>
-#include "cpuid.h"
#include "check.h"
#ifndef ALIGNMENT
@@ -44,14 +43,7 @@ int
main (void)
{
__m128 x = { 1.0 };
- unsigned int eax, ebx, ecx, edx;
-
- if (!__get_cpuid (1, &eax, &ebx, &ecx, &edx))
- return 0;
-
- /* Run SSE2 test only if host has SSE2 support. */
- if (edx & bit_SSE2)
- foo (x, x, x, 5);
+ foo (x, x, x, 5);
return 0;
}
diff --git a/gcc/testsuite/gcc.dg/torture/stackalign/alloca-3.c b/gcc/testsuite/gcc.dg/torture/stackalign/alloca-3.c
index ffe52f2a3e0..31cb0c472b5 100644
--- a/gcc/testsuite/gcc.dg/torture/stackalign/alloca-3.c
+++ b/gcc/testsuite/gcc.dg/torture/stackalign/alloca-3.c
@@ -1,10 +1,9 @@
/* PR middle-end/37009 */
/* { dg-do run { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
/* { dg-options "-msse2" } */
-/* { dg-require-effective-target sse2 } */
+/* { dg-require-effective-target sse2_runtime } */
#include <emmintrin.h>
-#include "cpuid.h"
#include "check.h"
#ifndef ALIGNMENT
@@ -44,14 +43,7 @@ int
main (void)
{
__m128 x = { 1.0 };
- unsigned int eax, ebx, ecx, edx;
-
- if (!__get_cpuid (1, &eax, &ebx, &ecx, &edx))
- return 0;
-
- /* Run SSE2 test only if host has SSE2 support. */
- if (edx & bit_SSE2)
- foo (x, x, x, x, 5);
+ foo (x, x, x, x, 5);
return 0;
}
diff --git a/gcc/testsuite/gcc.dg/torture/stackalign/push-1.c b/gcc/testsuite/gcc.dg/torture/stackalign/push-1.c
index c020d731293..dd5dffc1581 100644
--- a/gcc/testsuite/gcc.dg/torture/stackalign/push-1.c
+++ b/gcc/testsuite/gcc.dg/torture/stackalign/push-1.c
@@ -1,10 +1,9 @@
/* PR middle-end/37010 */
/* { dg-do run { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
/* { dg-options "-msse2 -mpreferred-stack-boundary=2" } */
-/* { dg-require-effective-target sse2 } */
+/* { dg-require-effective-target sse2_runtime } */
#include <emmintrin.h>
-#include "cpuid.h"
typedef __PTRDIFF_TYPE__ ptrdiff_t;
typedef float __m128 __attribute__ ((__vector_size__ (16), __may_alias__));
@@ -42,19 +41,11 @@ int
main (void)
{
__m128 x = { 1.0 };
- unsigned int eax, ebx, ecx, edx;
-
- if (!__get_cpuid (1, &eax, &ebx, &ecx, &edx))
- return 0;
- /* Run SSE2 test only if host has SSE2 support. */
- if (edx & bit_SSE2)
- {
- foo (x, x, x, x, 5);
+ foo (x, x, x, x, 5);
- if (__builtin_memcmp (&r, &x, sizeof (r)))
- abort ();
- }
+ if (__builtin_memcmp (&r, &x, sizeof (r)))
+ abort ();
return 0;
}
diff --git a/gcc/testsuite/gcc.dg/torture/stackalign/vararg-3.c b/gcc/testsuite/gcc.dg/torture/stackalign/vararg-3.c
index 3e34cf148b7..5b49685fa82 100644
--- a/gcc/testsuite/gcc.dg/torture/stackalign/vararg-3.c
+++ b/gcc/testsuite/gcc.dg/torture/stackalign/vararg-3.c
@@ -1,11 +1,10 @@
/* PR middle-end/37009 */
/* { dg-do run { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
/* { dg-options "-msse2" } */
-/* { dg-require-effective-target sse2 } */
+/* { dg-require-effective-target sse2_runtime } */
#include <stdarg.h>
#include <emmintrin.h>
-#include "cpuid.h"
#include "check.h"
#ifndef ALIGNMENT
@@ -72,14 +71,8 @@ int
main (void)
{
__m128 x = { 1.0 };
- unsigned int eax, ebx, ecx, edx;
-
- if (!__get_cpuid (1, &eax, &ebx, &ecx, &edx))
- return 0;
-
- /* Run SSE2 test only if host has SSE2 support. */
- if (edx & bit_SSE2)
- foo ("foo", 5, 5.0, x);
+
+ foo ("foo", 5, 5.0, x);
return 0;
}