aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJoseph Myers <jsm@polyomino.org.uk>2002-12-24 19:08:41 +0000
committerJoseph Myers <jsm28@gcc.gnu.org>2002-12-24 19:08:41 +0000
commit40aa9d95e2f81b94d4eccf64d870dea3fe9e4083 (patch)
treebbf4446930559e86e23a947c37faf9c3a6df65e5 /gcc
parent4fbf9d4ad97b137255abe8d0960ad377d61f4838 (diff)
downloadgcc-40aa9d95e2f81b94d4eccf64d870dea3fe9e4083.zip
gcc-40aa9d95e2f81b94d4eccf64d870dea3fe9e4083.tar.gz
gcc-40aa9d95e2f81b94d4eccf64d870dea3fe9e4083.tar.bz2
new1.C, [...]: Add tests previously added only to 3.1 or 3.2 branch.
* g++.dg/init/new1.C, g++.dg/template/alignof1.C, gcc.c-torture/compile/20021015-1.c, gcc.c-torture/compile/20021015-2.c, gcc.c-torture/compile/20021123-1.c, gcc.c-torture/compile/20021123-2.c, gcc.c-torture/compile/20021123-3.c, gcc.c-torture/compile/20021123-4.c, gcc.c-torture/execute/20021024-1.c: Add tests previously added only to 3.1 or 3.2 branch. From-SVN: r60479
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/ChangeLog12
-rw-r--r--gcc/testsuite/g++.dg/init/new1.C20
-rw-r--r--gcc/testsuite/g++.dg/template/alignof1.C13
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20021015-1.c12
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20021015-2.c7
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20021123-1.c10
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20021123-2.c9
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20021123-3.c9
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20021123-4.c11
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/20021024-1.c43
10 files changed, 146 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index c401110..7771c26 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,15 @@
+2002-12-24 Joseph S. Myers <jsm@polyomino.org.uk>
+
+ * g++.dg/init/new1.C, g++.dg/template/alignof1.C,
+ gcc.c-torture/compile/20021015-1.c,
+ gcc.c-torture/compile/20021015-2.c,
+ gcc.c-torture/compile/20021123-1.c,
+ gcc.c-torture/compile/20021123-2.c,
+ gcc.c-torture/compile/20021123-3.c,
+ gcc.c-torture/compile/20021123-4.c,
+ gcc.c-torture/execute/20021024-1.c: Add tests previously added
+ only to 3.1 or 3.2 branch.
+
2002-12-23 Mark Mitchell <mark@codesourcery.com>
* testsuite/gcc.dg/i386-bitfield3.c: New test.
diff --git a/gcc/testsuite/g++.dg/init/new1.C b/gcc/testsuite/g++.dg/init/new1.C
new file mode 100644
index 0000000..24b60d3
--- /dev/null
+++ b/gcc/testsuite/g++.dg/init/new1.C
@@ -0,0 +1,20 @@
+// Origin: asharji@uwaterloo.ca
+
+// { dg-do compile }
+// { dg-options "-fvolatile" }
+
+typedef __SIZE_TYPE__ size_t;
+
+class bar {
+ int i;
+ public :
+ void * operator new ( size_t , void * storage );
+};
+
+class foo {
+ int storage[ 5 ];
+ public:
+ void mem ( ) {
+ bar *s = new ( ( void * ) & storage ) bar;
+ }
+};
diff --git a/gcc/testsuite/g++.dg/template/alignof1.C b/gcc/testsuite/g++.dg/template/alignof1.C
new file mode 100644
index 0000000..50a3218
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/alignof1.C
@@ -0,0 +1,13 @@
+template<typename T>
+int my_alignof()
+{
+ return __alignof__(T);
+}
+
+template<typename>
+struct X { };
+
+int main()
+{
+ return my_alignof<X<void> >();
+}
diff --git a/gcc/testsuite/gcc.c-torture/compile/20021015-1.c b/gcc/testsuite/gcc.c-torture/compile/20021015-1.c
new file mode 100644
index 0000000..789b8a8
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/20021015-1.c
@@ -0,0 +1,12 @@
+/* PR target/7370. */
+
+int g (int *x, int *y);
+
+void f ()
+{
+ int x, y;
+ char a[4000];
+
+ g (&x, &y);
+ x = x/y + x;
+}
diff --git a/gcc/testsuite/gcc.c-torture/compile/20021015-2.c b/gcc/testsuite/gcc.c-torture/compile/20021015-2.c
new file mode 100644
index 0000000..6b158c5
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/20021015-2.c
@@ -0,0 +1,7 @@
+/* PR target/8232. */
+
+int f (char *p, char *q, int i)
+{
+ return bcmp (p, q, i);
+}
+
diff --git a/gcc/testsuite/gcc.c-torture/compile/20021123-1.c b/gcc/testsuite/gcc.c-torture/compile/20021123-1.c
new file mode 100644
index 0000000..dd2aa7e
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/20021123-1.c
@@ -0,0 +1,10 @@
+/* PR c/8439 */
+/* Verify that GCC properly handles null increments. */
+
+struct empty {
+};
+
+void foo(struct empty *p)
+{
+ p++;
+}
diff --git a/gcc/testsuite/gcc.c-torture/compile/20021123-2.c b/gcc/testsuite/gcc.c-torture/compile/20021123-2.c
new file mode 100644
index 0000000..423f8ec
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/20021123-2.c
@@ -0,0 +1,9 @@
+/* PR c/8518 */
+/* Contributed by Volker Reichelt. */
+
+/* Verify that GCC doesn't get confused by the
+ redefinition of an extern inline function. */
+
+extern int inline foo () { return 0; }
+extern int inline bar () { return 0; }
+static int inline bar () { return foo(); }
diff --git a/gcc/testsuite/gcc.c-torture/compile/20021123-3.c b/gcc/testsuite/gcc.c-torture/compile/20021123-3.c
new file mode 100644
index 0000000..51f0e25
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/20021123-3.c
@@ -0,0 +1,9 @@
+/* PR c/8518 */
+/* Contributed by Volker Reichelt. */
+
+/* Verify that GCC doesn't get confused by the
+ redefinition of an extern inline function. */
+
+extern int inline foo () { return 0; }
+extern int inline bar () { return 0; }
+static int bar () { return foo(); }
diff --git a/gcc/testsuite/gcc.c-torture/compile/20021123-4.c b/gcc/testsuite/gcc.c-torture/compile/20021123-4.c
new file mode 100644
index 0000000..d4306b8
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/20021123-4.c
@@ -0,0 +1,11 @@
+/* PR c/8588 */
+/* Contributed by Volker Reichelt. */
+
+/* Verify that GCC converts integer constants
+ in shift operations. */
+
+void foo()
+{
+ unsigned int i, j;
+ j = (i >> 0xf0);
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/20021024-1.c b/gcc/testsuite/gcc.c-torture/execute/20021024-1.c
new file mode 100644
index 0000000..f7d98e9
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/20021024-1.c
@@ -0,0 +1,43 @@
+/* Origin: PR target/6981 from Mattias Engdegaard <mattias@virtutech.se>. */
+
+void exit (int);
+void abort (void);
+
+unsigned long long *cp, m;
+
+void foo (void)
+{
+}
+
+void bar (unsigned rop, unsigned long long *r)
+{
+ unsigned rs1, rs2, rd;
+
+top:
+ rs2 = (rop >> 23) & 0x1ff;
+ rs1 = (rop >> 9) & 0x1ff;
+ rd = rop & 0x1ff;
+
+ *cp = 1;
+ m = r[rs1] + r[rs2];
+ *cp = 2;
+ foo();
+ if (!rd)
+ goto top;
+ r[rd] = 1;
+}
+
+int main(void)
+{
+ static unsigned long long r[64];
+ unsigned long long cr;
+ cp = &cr;
+
+ r[4] = 47;
+ r[8] = 11;
+ bar((8 << 23) | (4 << 9) | 15, r);
+
+ if (m != 47 + 11)
+ abort ();
+ exit (0);
+}