aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg
diff options
context:
space:
mode:
authorAndrew Hsieh <andrewhsieh@google.com>2014-09-03 15:56:31 (GMT)
committerGerrit Code Review <noreply-gerritcodereview@google.com>2014-09-03 15:56:31 (GMT)
commit4254ad78d813b8c4cfc6c07218aee6b1be554f23 (patch)
tree8e9350d7e0339c5c7da9499ab5742527e21520c6 /gcc-4.9/gcc/testsuite/gcc.dg
parent9bba04175106d9b9e8a58715e3e7fa560c13e092 (diff)
parente97c99f15937e5762a973b25192aab824126a6d3 (diff)
downloadtoolchain_gcc-4254ad78d813b8c4cfc6c07218aee6b1be554f23.zip
toolchain_gcc-4254ad78d813b8c4cfc6c07218aee6b1be554f23.tar.gz
toolchain_gcc-4254ad78d813b8c4cfc6c07218aee6b1be554f23.tar.bz2
Merge "[gcc-4.9] Merge svn r214745 from google/gcc-4_9 branch. Merge gcc-4_9 source r214745 from google/gcc-4_9 branch."
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.dg')
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/atomic/c11-atomic-exec-4.c2
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/atomic/c11-atomic-exec-5.c2
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-flag.c1
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/pr60449_0.c30
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/pr60449_1.c76
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr51879-18.c2
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr57233.c1
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr59418.c2
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr61756.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr61776.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr62004.c47
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr62030.c50
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr61964.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-copyprop-2.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr62073.c40
15 files changed, 336 insertions, 4 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/atomic/c11-atomic-exec-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/atomic/c11-atomic-exec-4.c
index 1558200..b03d2c8 100644
--- a/gcc-4.9/gcc/testsuite/gcc.dg/atomic/c11-atomic-exec-4.c
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/atomic/c11-atomic-exec-4.c
@@ -2,7 +2,7 @@
operating properly when operations on the same variable are carried
out in two threads. */
/* { dg-do run } */
-/* { dg-options "-std=c11 -pedantic-errors -pthread -D_POSIX_C_SOURCE=200809L" } */
+/* { dg-options "-std=c11 -pedantic-errors -pthread -U_POSIX_C_SOURCE -D_POSIX_C_SOURCE=200809L" } */
/* { dg-additional-options "-D_XOPEN_SOURCE=600" { target *-*-solaris2.1[0-9]* } }
/* { dg-require-effective-target pthread } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/atomic/c11-atomic-exec-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/atomic/c11-atomic-exec-5.c
index bc87de4..e3e0aae 100644
--- a/gcc-4.9/gcc/testsuite/gcc.dg/atomic/c11-atomic-exec-5.c
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/atomic/c11-atomic-exec-5.c
@@ -3,7 +3,7 @@
iterations of the compare-and-exchange loop are needed, exceptions
get properly cleared). */
/* { dg-do run } */
-/* { dg-options "-std=c11 -pedantic-errors -pthread -D_POSIX_C_SOURCE=200809L" } */
+/* { dg-options "-std=c11 -pedantic-errors -pthread -U_POSIX_C_SOURCE -D_POSIX_C_SOURCE=200809L" } */
/* { dg-additional-options "-D_XOPEN_SOURCE=600" { target *-*-solaris2.1[0-9]* } }
/* { dg-require-effective-target fenv_exceptions } */
/* { dg-require-effective-target pthread } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-flag.c b/gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-flag.c
index c1a63f1..515d5d8 100644
--- a/gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-flag.c
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-flag.c
@@ -1,4 +1,5 @@
/* Test atomic_flag routines for existence and execution. */
+/* The test needs a lockless atomic implementation. */
/* { dg-do run { xfail hppa*-*-hpux* } } */
/* { dg-options "-std=c11 -pedantic-errors" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr60449_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr60449_0.c
new file mode 100644
index 0000000..a430830
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr60449_0.c
@@ -0,0 +1,30 @@
+/* { dg-lto-do link } */
+
+extern int printf (const char *__restrict __format, ...);
+typedef long int __time_t;
+typedef long int __suseconds_t;
+
+struct timeval
+ {
+ __time_t tv_sec;
+ __suseconds_t tv_usec;
+ };
+
+struct timezone
+ {
+ int tz_minuteswest;
+ int tz_dsttime;
+ };
+typedef struct timezone *__restrict __timezone_ptr_t;
+
+extern int gettimeofday (struct timeval *__restrict __tv, __timezone_ptr_t __tz);
+
+int bar (void)
+{
+ struct timeval tv;
+ struct timezone tz;
+
+ gettimeofday (&tv, &tz);
+ printf ("This is from bar %i\n", tz.tz_dsttime);
+ return 5;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr60449_1.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr60449_1.c
new file mode 100644
index 0000000..ddc2529
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr60449_1.c
@@ -0,0 +1,76 @@
+extern int printf (const char *__restrict __format, ...);
+typedef long int __time_t;
+typedef long int __suseconds_t;
+struct timeval
+ {
+ __time_t tv_sec;
+ __suseconds_t tv_usec;
+ };
+struct timezone
+ {
+ int tz_minuteswest;
+ int tz_dsttime;
+ };
+typedef struct timezone *__restrict __timezone_ptr_t;
+extern int gettimeofday (struct timeval *__restrict __tv,
+ __timezone_ptr_t __tz) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
+
+typedef long int __jmp_buf[8];
+typedef struct
+ {
+ unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))];
+ } __sigset_t;
+struct __jmp_buf_tag
+ {
+ __jmp_buf __jmpbuf;
+ int __mask_was_saved;
+ __sigset_t __saved_mask;
+ };
+typedef struct __jmp_buf_tag jmp_buf[1];
+
+extern int setjmp (jmp_buf __env) __attribute__ ((__nothrow__));
+extern void longjmp (struct __jmp_buf_tag __env[1], int __val)
+ __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));
+
+extern int bar (void);
+
+int __attribute__ ((noinline, noclone))
+get_input (void)
+{
+ return 0;
+}
+
+static jmp_buf buf;
+
+int foo (void)
+{
+ if (get_input ())
+ longjmp(buf, 1);
+ return 0;
+}
+
+volatile int z;
+
+
+int main (void)
+{
+ struct timeval tv;
+ struct timezone tz;
+
+ bar();
+ if (setjmp (buf))
+ return 1;
+
+ if (!get_input ())
+ {
+ gettimeofday (&tv, &tz);
+ z = 0;
+ printf ("This is from main %i\n", tz.tz_dsttime);
+ }
+
+ foo ();
+ bar ();
+ bar ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr51879-18.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr51879-18.c
index 95629f1..9b3cb80 100644
--- a/gcc-4.9/gcc/testsuite/gcc.dg/pr51879-18.c
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr51879-18.c
@@ -13,5 +13,5 @@ void bar (int c, int *p)
*q = foo ();
}
-/* { dg-final { scan-tree-dump-times "foo \\(" 1 "pre"} } */
+/* { dg-final { scan-tree-dump-times "foo \\(" 1 "pre" { xfail *-*-* } } } */
/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr57233.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr57233.c
index 58c0534..484844e 100644
--- a/gcc-4.9/gcc/testsuite/gcc.dg/pr57233.c
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr57233.c
@@ -1,6 +1,7 @@
/* PR tree-optimization/57233 */
/* { dg-do run { target { ilp32 || lp64 } } } */
/* { dg-options "-O2" } */
+/* { dg-additional-options "-fno-common" { target hppa*-*-hpux* } } */
typedef unsigned V4 __attribute__((vector_size(4 * sizeof (int))));
typedef unsigned V8 __attribute__((vector_size(8 * sizeof (int))));
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr59418.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr59418.c
index 114c1d3..257ce79 100644
--- a/gcc-4.9/gcc/testsuite/gcc.dg/pr59418.c
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr59418.c
@@ -3,7 +3,7 @@
/* { dg-do compile } */
/* { dg-options "-Os -g" } */
-/* { dg-options "-march=armv7-a -mfloat-abi=hard -Os -g" { target arm*-*-* } } */
+/* { dg-options "-march=armv7-a -mfloat-abi=hard -Os -g" { target { arm*-*-* && { ! arm_thumb1 } } } } */
extern int printf (const char *__format, ...);
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr61756.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr61756.c
new file mode 100644
index 0000000..4ca9044
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr61756.c
@@ -0,0 +1,14 @@
+/* PR target/61756 */
+
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+#include <stdatomic.h>
+
+static volatile atomic_flag guard = ATOMIC_FLAG_INIT;
+
+void
+try_atomic_flag_test_and_set (void)
+{
+ atomic_flag_test_and_set (&guard);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr61776.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr61776.c
new file mode 100644
index 0000000..8768c54
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr61776.c
@@ -0,0 +1,27 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fprofile-generate" } */
+
+#include <setjmp.h>
+
+int cond1, cond2;
+
+int goo() __attribute__((noinline));
+
+int goo() {
+ if (cond1)
+ return 1;
+ else
+ return 2;
+}
+
+jmp_buf env;
+int foo() {
+ int a;
+
+ setjmp(env);
+ if (cond2)
+ a = goo();
+ else
+ a = 3;
+ return a;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr62004.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr62004.c
new file mode 100644
index 0000000..c994a41
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr62004.c
@@ -0,0 +1,47 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -fno-tree-tail-merge" } */
+
+struct node
+{
+ struct node *next;
+ struct node *prev;
+};
+
+struct node node;
+
+struct head
+{
+ struct node *first;
+};
+
+struct head heads[5];
+
+int k = 2;
+
+struct head *head = &heads[2];
+
+int
+main ()
+{
+ struct node *p;
+
+ node.next = (void*)0;
+
+ node.prev = (void *)head;
+
+ head->first = &node;
+
+ struct node *n = head->first;
+
+ struct head *h = &heads[k];
+
+ heads[2].first = n->next;
+
+ if ((void*)n->prev == (void *)h)
+ p = h->first;
+ else
+ /* Dead tbaa-unsafe load from ((struct node *)&heads[2])->next. */
+ p = n->prev->next;
+
+ return !(p == (void*)0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr62030.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr62030.c
new file mode 100644
index 0000000..b8baf93
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr62030.c
@@ -0,0 +1,50 @@
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+extern void abort (void);
+
+struct node
+{
+ struct node *next;
+ struct node *prev;
+};
+
+struct node node;
+
+struct head
+{
+ struct node *first;
+};
+
+struct head heads[5];
+
+int k = 2;
+
+struct head *head = &heads[2];
+
+static int __attribute__((noinline))
+foo (void)
+{
+ node.prev = (void *)head;
+ head->first = &node;
+
+ struct node *n = head->first;
+ struct head *h = &heads[k];
+ struct node *next = n->next;
+
+ if (n->prev == (void *)h)
+ h->first = next;
+ else
+ n->prev->next = next;
+
+ n->next = h->first;
+ return n->next == &node;
+}
+
+int
+main (void)
+{
+ if (foo ())
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr61964.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr61964.c
new file mode 100644
index 0000000..a03cfdc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr61964.c
@@ -0,0 +1,33 @@
+/* { dg-do run } */
+
+extern void abort (void);
+
+struct node { struct node *next, *prev; } node;
+struct head { struct node *first; } heads[5];
+int k = 2;
+struct head *head = &heads[2];
+
+static int __attribute__((noinline))
+foo()
+{
+ node.prev = (void *)head;
+ head->first = &node;
+
+ struct node *n = head->first;
+ struct head *h = &heads[k];
+
+ if (n->prev == (void *)h)
+ h->first = n->next;
+ else
+ n->prev->next = n->next;
+
+ n->next = h->first;
+ return n->next == &node;
+}
+
+int main()
+{
+ if (foo ())
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-copyprop-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-copyprop-2.c
new file mode 100644
index 0000000..9757013
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-copyprop-2.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-Og -fdump-tree-optimized" } */
+
+extern long long __sdt_unsp;
+void
+f(void)
+{
+ for (;;)
+ __asm__ ("%0" :: "i" (((!__extension__ (__builtin_constant_p ((((unsigned long long) (__typeof (__builtin_choose_expr (((__builtin_classify_type (0) + 3) & -4) == 4, (0), 0U))) __sdt_unsp) ) == 0) )) ? 1 : -1) ));
+}
+
+/* { dg-final { scan-tree-dump-not "PHI" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr62073.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr62073.c
new file mode 100644
index 0000000..15f2ad6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr62073.c
@@ -0,0 +1,40 @@
+/* { dg-do compile } */
+/* { dg-additional-options "-O1" } */
+
+struct S0
+{
+ int f7;
+};
+struct S0 g_50;
+int g_70;
+int g_76;
+
+int foo (long long p_56, int * p_57)
+{
+ int *l_77;
+ int l_101;
+
+ for (; g_70;)
+ {
+ int **l_78 = &l_77;
+ if (g_50.f7)
+ continue;
+ *l_78 = 0;
+ }
+ for (g_76 = 1; g_76 >= 0; g_76--)
+ {
+ int *l_90;
+ for (l_101 = 4; l_101 >= 0; l_101--)
+ if (l_101)
+ *l_90 = 0;
+ else
+ {
+ int **l_113 = &l_77;
+ *l_113 = p_57;
+ }
+ }
+
+ return *l_77;
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */