aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.c-torture
diff options
context:
space:
mode:
authorBen Cheng <bccheng@google.com>2014-04-22 20:33:12 (GMT)
committerBen Cheng <bccheng@google.com>2014-04-22 20:33:12 (GMT)
commite3cc64dec20832769406aa38cde83c7dd4194bf4 (patch)
treeef8e39be37cfe0cb69d850043b7924389ff17164 /gcc-4.9/gcc/testsuite/gcc.c-torture
parentf33c7b3122b1d7950efa88067c9a156229ba647b (diff)
downloadtoolchain_gcc-e3cc64dec20832769406aa38cde83c7dd4194bf4.zip
toolchain_gcc-e3cc64dec20832769406aa38cde83c7dd4194bf4.tar.gz
toolchain_gcc-e3cc64dec20832769406aa38cde83c7dd4194bf4.tar.bz2
[4.9] GCC 4.9.0 official release refresh
Change-Id: Ic99a7da8b44b789a48aeec93b33e93944d6e6767
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.c-torture')
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.c-torture/compile/pr28865.c2
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.c-torture/compile/pr60556.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.c-torture/compile/pr60655-1.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.c-torture/compile/pr60655-2.c30
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.c-torture/execute/20140326-1.c10
5 files changed, 81 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.c-torture/compile/pr28865.c b/gcc-4.9/gcc/testsuite/gcc.c-torture/compile/pr28865.c
index aa6ae07..4ad0f5c 100644
--- a/gcc-4.9/gcc/testsuite/gcc.c-torture/compile/pr28865.c
+++ b/gcc-4.9/gcc/testsuite/gcc.c-torture/compile/pr28865.c
@@ -1,3 +1,5 @@
+/* { dg-xfail-if "PR target/60602" { sparc*-*-solaris2.9* && { ! gas } } { "-O0" } } */
+
struct var_len
{
int field1;
diff --git a/gcc-4.9/gcc/testsuite/gcc.c-torture/compile/pr60556.c b/gcc-4.9/gcc/testsuite/gcc.c-torture/compile/pr60556.c
new file mode 100644
index 0000000..c775432
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.c-torture/compile/pr60556.c
@@ -0,0 +1,8 @@
+/* PR middle-end/60556 */
+
+int g (int);
+
+unsigned long long f (void)
+{
+ return (unsigned long long)(long)&g;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.c-torture/compile/pr60655-1.c b/gcc-4.9/gcc/testsuite/gcc.c-torture/compile/pr60655-1.c
new file mode 100644
index 0000000..6f84f6e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.c-torture/compile/pr60655-1.c
@@ -0,0 +1,31 @@
+/* { dg-options "-fdata-sections" } */
+
+typedef unsigned char unit;
+typedef unit *unitptr;
+extern short global_precision;
+typedef __SIZE_TYPE__ size_t;
+extern void *memcpy (void *dest, const void *src, size_t n);
+
+short mp_compare(const unit* r1, const unit* r2)
+{
+ register short precision;
+ precision = global_precision;
+ (r1) = ((r1)+(precision)-1);
+ (r2) = ((r2)+(precision)-1);
+ do
+ { if (*r1 < *r2)
+ return(-1);
+ if (*((r1)--) > *((r2)--))
+ return(1);
+ } while (--precision);
+}
+
+static unit modulus[((1280+(2*8))/8)];
+static unit d_data[((1280+(2*8))/8)*2];
+
+int upton_modmult (unitptr prod, unitptr multiplicand, unitptr multiplier)
+{
+ unitptr d = d_data;
+ while (mp_compare(d,modulus) > 0)
+ memcpy((void*)(prod), (const void*)(d), (global_precision));
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.c-torture/compile/pr60655-2.c b/gcc-4.9/gcc/testsuite/gcc.c-torture/compile/pr60655-2.c
new file mode 100644
index 0000000..f33db64
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.c-torture/compile/pr60655-2.c
@@ -0,0 +1,30 @@
+
+typedef unsigned char unit;
+typedef unit *unitptr;
+extern short global_precision;
+typedef __SIZE_TYPE__ size_t;
+extern void *memcpy (void *dest, const void *src, size_t n);
+
+short mp_compare(const unit* r1, const unit* r2)
+{
+ register short precision;
+ precision = global_precision;
+ (r1) = ((r1)+(precision)-1);
+ (r2) = ((r2)+(precision)-1);
+ do
+ { if (*r1 < *r2)
+ return(-1);
+ if (*((r1)--) > *((r2)--))
+ return(1);
+ } while (--precision);
+}
+
+static unit modulus[((1280+(2*8))/8)];
+static unit d_data[((1280+(2*8))/8)*2];
+
+int upton_modmult (unitptr prod, unitptr multiplicand, unitptr multiplier)
+{
+ unitptr d = d_data;
+ while (mp_compare(d,modulus) > 0)
+ memcpy((void*)(prod), (const void*)(d), (global_precision));
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.c-torture/execute/20140326-1.c b/gcc-4.9/gcc/testsuite/gcc.c-torture/execute/20140326-1.c
new file mode 100644
index 0000000..552e218
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.c-torture/execute/20140326-1.c
@@ -0,0 +1,10 @@
+int a;
+
+int
+main (void)
+{
+ char e[2] = { 0, 0 }, f = 0;
+ if (a == 131072)
+ f = e[a];
+ return f;
+}