aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg')
-rw-r--r--gcc/testsuite/gcc.dg/20020312-2.c2
-rw-r--r--gcc/testsuite/gcc.dg/cleanup-13.c15
-rw-r--r--gcc/testsuite/gcc.dg/cpp/_Pragma6.c2
-rw-r--r--gcc/testsuite/gcc.dg/debug/pr42767.c18
-rw-r--r--gcc/testsuite/gcc.dg/guality/pr42782.c24
-rw-r--r--gcc/testsuite/gcc.dg/pr19340.c2
-rw-r--r--gcc/testsuite/gcc.dg/pr19988.c14
-rw-r--r--gcc/testsuite/gcc.dg/pr42715.c59
-rw-r--r--gcc/testsuite/gcc.dg/pr42719.c14
-rw-r--r--gcc/testsuite/gcc.dg/pr42728.c11
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/20040204-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/asm-3.c4
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/pr42585.c37
-rw-r--r--gcc/testsuite/gcc.dg/weak/typeof-2.c2
14 files changed, 202 insertions, 4 deletions
diff --git a/gcc/testsuite/gcc.dg/20020312-2.c b/gcc/testsuite/gcc.dg/20020312-2.c
index 057c19e1a99..bf8225a1a6b 100644
--- a/gcc/testsuite/gcc.dg/20020312-2.c
+++ b/gcc/testsuite/gcc.dg/20020312-2.c
@@ -46,6 +46,8 @@ extern void abort (void);
/* No pic register. */
#elif defined(__mn10300__)
/* No pic register. */
+#elif defined(__moxie__)
+/* No pic register. */
#elif defined(__hppa__)
/* PIC register is %r27 or %r19, but is used even without -fpic. */
#elif defined(__pdp11__)
diff --git a/gcc/testsuite/gcc.dg/cleanup-13.c b/gcc/testsuite/gcc.dg/cleanup-13.c
index 0a5a9e9153e..5a0d4c69f5a 100644
--- a/gcc/testsuite/gcc.dg/cleanup-13.c
+++ b/gcc/testsuite/gcc.dg/cleanup-13.c
@@ -210,9 +210,22 @@ OP_const1s(-123) OP_abs OP_const1u(123) OP_eq ASSERT_TOS_NON0 \
OP_lit3 OP_lit6 OP_and OP_lit2 OP_eq ASSERT_TOS_NON0 \
OP_lit3 OP_lit6 OP_or OP_lit7 OP_eq ASSERT_TOS_NON0 \
OP_lit17 OP_lit2 OP_minus OP_lit15 OP_eq ASSERT_TOS_NON0 \
+/* Divide is signed truncating toward zero. */ \
OP_const1s(-6) OP_const1s(-2) OP_div OP_lit3 OP_eq ASSERT_TOS_NON0 \
-OP_const1s(-6) OP_const1s(-4) OP_mod OP_const1s(-2) \
+OP_const1s(-7) OP_const1s(3) OP_div OP_const1s(-2) \
OP_eq ASSERT_TOS_NON0 \
+/* Modulo is unsigned. */ \
+OP_const1s(-6) OP_const1s(-4) OP_mod OP_const1s(-6) \
+ OP_eq ASSERT_TOS_NON0 \
+OP_const1s(-6) OP_lit4 OP_mod OP_lit2 OP_eq ASSERT_TOS_NON0 \
+OP_lit6 OP_const1s(-4) OP_mod OP_lit6 OP_eq ASSERT_TOS_NON0 \
+/* Signed modulo can be implemented using "over over div mul minus". */\
+OP_const1s(-6) OP_const1s(-4) OP_over OP_over OP_div OP_mul OP_minus \
+ OP_const1s(-2) OP_eq ASSERT_TOS_NON0 \
+OP_const1s(-7) OP_lit3 OP_over OP_over OP_div OP_mul OP_minus \
+ OP_const1s(-1) OP_eq ASSERT_TOS_NON0 \
+OP_lit7 OP_const1s(-3) OP_over OP_over OP_div OP_mul OP_minus \
+ OP_lit1 OP_eq ASSERT_TOS_NON0 \
OP_lit16 OP_lit31 OP_plus_uconst(1) OP_mul OP_const2u(512) \
OP_eq ASSERT_TOS_NON0 \
OP_lit5 OP_not OP_lit31 OP_and OP_lit26 OP_eq ASSERT_TOS_NON0 \
diff --git a/gcc/testsuite/gcc.dg/cpp/_Pragma6.c b/gcc/testsuite/gcc.dg/cpp/_Pragma6.c
index 986b40cb156..a5324f2f9be 100644
--- a/gcc/testsuite/gcc.dg/cpp/_Pragma6.c
+++ b/gcc/testsuite/gcc.dg/cpp/_Pragma6.c
@@ -2,7 +2,7 @@
/* This is supposed to succeed only if
the target defines HANDLE_PRAGMA_PACK_PUSH_POP
and doesn't define HANDLE_PRAGMA_PACK_WITH_EXPANSION. */
-/* { dg-do compile { target { ! { powerpc-ibm-aix* *-*-solaris2* fido-*-* m68k-*-* sh*-[us]*-elf m32c-*-* *-*-vxworks } } } } */
+/* { dg-do compile { target { ! { powerpc-ibm-aix* *-*-solaris2* fido-*-* m68k-*-* sh*-[us]*-elf m32c-*-* *-*-vxworks moxie-*-* } } } } */
#define push bar
#define foo _Pragma ("pack(push)")
diff --git a/gcc/testsuite/gcc.dg/debug/pr42767.c b/gcc/testsuite/gcc.dg/debug/pr42767.c
new file mode 100644
index 00000000000..1f0e25fe58e
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/debug/pr42767.c
@@ -0,0 +1,18 @@
+/* PR debug/42767 */
+/* { dg-do compile } */
+/* { dg-options "-O1 -g" } */
+
+struct lineno_cache_entry
+{
+ unsigned long size;
+};
+_bfd_link_section_stabs (struct lineno_cache_entry * stabsec)
+{
+ unsigned long count;
+ unsigned char *sym;
+ unsigned char *symend;
+ unsigned long skip;
+ count = stabsec->size / 12;
+ for (; sym < symend; sym += 1);
+ stabsec->size = (count - skip) * 12;
+}
diff --git a/gcc/testsuite/gcc.dg/guality/pr42782.c b/gcc/testsuite/gcc.dg/guality/pr42782.c
new file mode 100644
index 00000000000..6a880814aaf
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/guality/pr42782.c
@@ -0,0 +1,24 @@
+/* { dg-options "-g" } */
+
+#include "guality.h"
+
+void __attribute__ ((__noinline__))
+g (void)
+{
+ asm volatile ("");
+}
+
+int
+f (int a)
+{
+ g ();
+ GUALCHKVAL (a);
+ return a;
+}
+
+int
+main (int argc, char *argv[])
+{
+ f (argc + 2);
+ f (argc + 5);
+}
diff --git a/gcc/testsuite/gcc.dg/pr19340.c b/gcc/testsuite/gcc.dg/pr19340.c
index 844d80677d0..58a919b4586 100644
--- a/gcc/testsuite/gcc.dg/pr19340.c
+++ b/gcc/testsuite/gcc.dg/pr19340.c
@@ -1,6 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-O1 -fschedule-insns2 -fsched2-use-traces" } */
-/* { dg-skip-if "No scheduling" { mmix-*-* cris-*-* crisv32-*-* fido-*-* m68k-*-* m32c-*-* avr-*-* } { "*" } { "" } } */
+/* { dg-skip-if "No scheduling" { mmix-*-* cris-*-* crisv32-*-* fido-*-* m68k-*-* m32c-*-* avr-*-* moxie-*-* } { "*" } { "" } } */
extern double f (double x);
diff --git a/gcc/testsuite/gcc.dg/pr19988.c b/gcc/testsuite/gcc.dg/pr19988.c
new file mode 100644
index 00000000000..aa2fed13961
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr19988.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-optimized -fdump-tree-original" } */
+
+double foo(double x, double y)
+{
+ return ((x + 0.1234 * y) * (x - 0.1234 * y));
+}
+
+/* Keep positive constants during folding. */
+/* { dg-final { scan-tree-dump-times " 1.23" 2 "original" } } */
+/* CSE one multiplication. */
+/* { dg-final { scan-tree-dump-times " \\\* " 2 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "original" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc/testsuite/gcc.dg/pr42715.c b/gcc/testsuite/gcc.dg/pr42715.c
new file mode 100644
index 00000000000..72bdfc86244
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr42715.c
@@ -0,0 +1,59 @@
+/* { dg-do compile { target fpic } } */
+/* { dg-options "-fPIC -g -O2 -w" } */
+/* var-tracking failed to clobber the reg holding v at the asm insn,
+ so v ended up bound to an intermediate PIC expression. */
+
+struct A { unsigned a1; char a2[15]; };
+struct B { long b1; unsigned char b2; long b3; };
+struct C { void *c1; unsigned c2; unsigned c3; };
+
+static struct A v1;
+struct A *const v2 = &v1;
+
+static inline
+int foo (void)
+{
+ int *v;
+ __asm__ __volatile__ ("" : "=r" (v));
+ return v[1];
+}
+
+static void
+bar (struct C *x)
+{
+ if (x->c2 == x->c3 && x->c1)
+ f1 (foo (), x->c1, x->c3 * sizeof (x->c1[0]));
+}
+
+void
+baz (struct B *y)
+{
+ int i;
+ const char *j;
+ char *k;
+ char x[64];
+ for (i = 0; i < sizeof (struct B); i++, y)
+ {
+ switch (y->b2)
+ {
+ case 0x20:
+ if (__builtin_strchr (j, '='))
+ continue;
+ }
+ switch (y->b2)
+ {
+ case 0x80:
+ bar (&x);
+ f2 (y->b3);
+ case 0x2e:
+ case 0x4e:
+ break;
+ default:
+ if (v2->a1)
+ f2 (y->b2);
+ }
+ k[0] = '\0';
+ if (v2->a1)
+ f2 (y->b1);
+ }
+}
diff --git a/gcc/testsuite/gcc.dg/pr42719.c b/gcc/testsuite/gcc.dg/pr42719.c
new file mode 100644
index 00000000000..94a58e41a1a
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr42719.c
@@ -0,0 +1,14 @@
+/* PR tree-optimization/42719 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftracer -fcompare-debug" } */
+
+int *v;
+
+void
+foo (int a)
+{
+ int i, j;
+ for (j = i = a; i != -1; j = i, i = v[i])
+ ;
+ v[j] = v[a];
+}
diff --git a/gcc/testsuite/gcc.dg/pr42728.c b/gcc/testsuite/gcc.dg/pr42728.c
new file mode 100644
index 00000000000..7b2fbb690fb
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr42728.c
@@ -0,0 +1,11 @@
+/* PR debug/42728 */
+/* { dg-do compile } */
+/* { dg-options "-O1 -fcompare-debug" } */
+
+void
+foo (char *a)
+{
+ char *b;
+ for (; *a; a++)
+ a = b++;
+}
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20040204-1.c b/gcc/testsuite/gcc.dg/tree-ssa/20040204-1.c
index d7aea1b8430..e7566642cc0 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20040204-1.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20040204-1.c
@@ -33,5 +33,5 @@ void test55 (int x, int y)
that the && should be emitted (based on BRANCH_COST). Fix this
by teaching dom to look through && and register all components
as true. */
-/* { dg-final { scan-tree-dump-times "link_error" 0 "optimized" { xfail { ! "powerpc*-*-* cris-*-* crisv32-*-* mmix-*-* mips*-*-* m68k*-*-*" } } } } */
+/* { dg-final { scan-tree-dump-times "link_error" 0 "optimized" { xfail { ! "powerpc*-*-* cris-*-* crisv32-*-* mmix-*-* mips*-*-* m68k*-*-* moxie-*-*" } } } } */
/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/asm-3.c b/gcc/testsuite/gcc.dg/tree-ssa/asm-3.c
index e35d179c547..5ed282e49a1 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/asm-3.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/asm-3.c
@@ -5,8 +5,12 @@
#ifdef __hppa__
#define REGISTER "1"
#else
+#ifdef __moxie__
+#define REGISTER "8"
+#else
#define REGISTER "0"
#endif
+#endif
static inline int source(void)
{
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr42585.c b/gcc/testsuite/gcc.dg/tree-ssa/pr42585.c
new file mode 100644
index 00000000000..8a4edfce068
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr42585.c
@@ -0,0 +1,37 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-optimized" } */
+
+struct _fat_ptr
+{
+ unsigned char *curr;
+ unsigned char *base;
+ unsigned char *last_plus_one;
+};
+int Cyc_string_ungetc (int ignore, struct _fat_ptr *sptr);
+int
+Cyc_string_ungetc (int ignore, struct _fat_ptr *sptr)
+{
+ struct _fat_ptr *_T0;
+ struct _fat_ptr *_T1;
+ struct _fat_ptr _T2;
+ int _T3;
+ struct _fat_ptr _ans;
+ int _change;
+
+ {
+ _T0 = sptr;
+ _T1 = sptr;
+ _T2 = *sptr;
+ _T3 = -1;
+ _ans = _T2;
+ _change = -1;
+ _ans.curr += 4294967295U;
+ *sptr = _ans;
+ return (0);
+ }
+}
+
+/* The local aggregates . */
+/* { dg-final { scan-tree-dump-times "struct _fat_ptr _ans" 0 "optimized"} } */
+/* { dg-final { scan-tree-dump-times "struct _fat_ptr _T2" 0 "optimized"} } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc/testsuite/gcc.dg/weak/typeof-2.c b/gcc/testsuite/gcc.dg/weak/typeof-2.c
index 5d97dc5c240..63f427fc8c9 100644
--- a/gcc/testsuite/gcc.dg/weak/typeof-2.c
+++ b/gcc/testsuite/gcc.dg/weak/typeof-2.c
@@ -43,4 +43,6 @@ int bar3 (int x)
// Likewise for m68k targets.
// { dg-final { if [string match fido-*-* $target_triplet ] {return} } }
// { dg-final { if [string match m68k-*-* $target_triplet ] {return} } }
+// Likewise for moxie targets.
+// { dg-final { if [string match moxie-*-* $target_triplet ] {return} } }
// { dg-final { scan-assembler "baz3.*baz3.*baz3.*baz3.*baz3.*baz3" } }