]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
This commit was manufactured by cvs2svn to create branch
authorNo Author <no-author@gcc.gnu.org>
Thu, 23 Dec 2004 20:06:11 +0000 (20:06 +0000)
committerNo Author <no-author@gcc.gnu.org>
Thu, 23 Dec 2004 20:06:11 +0000 (20:06 +0000)
'gcc-3_4-branch'.

From-SVN: r92563

gcc/testsuite/g++.dg/ext/packed8.C [new file with mode: 0644]
gcc/testsuite/g++.dg/template/cond5.C [new file with mode: 0644]
gcc/testsuite/g++.dg/template/crash30.C [new file with mode: 0644]
gcc/testsuite/g++.dg/template/spec19.C [new file with mode: 0644]
libjava/testsuite/libjava.jni/iface.c [new file with mode: 0644]
libjava/testsuite/libjava.jni/iface.java [new file with mode: 0644]
libjava/testsuite/libjava.jni/iface.out [new file with mode: 0644]

diff --git a/gcc/testsuite/g++.dg/ext/packed8.C b/gcc/testsuite/g++.dg/ext/packed8.C
new file mode 100644 (file)
index 0000000..a68fa2c
--- /dev/null
@@ -0,0 +1,20 @@
+// PR c++/18378
+
+class A
+{
+public:
+  int i;
+
+  A() {}
+  A(const A& a) { i = a.i; }
+};
+
+class B
+{
+  A a __attribute__((packed));
+
+public:
+  B() {}
+  A GetA() { return a; } // { dg-error "" }
+};
+
diff --git a/gcc/testsuite/g++.dg/template/cond5.C b/gcc/testsuite/g++.dg/template/cond5.C
new file mode 100644 (file)
index 0000000..bba31e6
--- /dev/null
@@ -0,0 +1,9 @@
+// PR c++/18464
+
+struct A
+{
+  A(int);
+  operator void*() const;
+};
+
+template<int> void foo(const A& x) { 0 ? x : (x ? x : 0); }
diff --git a/gcc/testsuite/g++.dg/template/crash30.C b/gcc/testsuite/g++.dg/template/crash30.C
new file mode 100644 (file)
index 0000000..145b076
--- /dev/null
@@ -0,0 +1,16 @@
+// PR c++/19034
+
+template< bool C > struct B
+{
+};
+
+template<typename S> int foo();
+template<typename S> int foo1();
+
+template<typename T> struct bar : public B <(sizeof(foo<T>()) == 1)>
+{
+};
+
+template<typename T> struct bar1 : public B <(sizeof(foo1<T>()) == 1)>
+{
+};
diff --git a/gcc/testsuite/g++.dg/template/spec19.C b/gcc/testsuite/g++.dg/template/spec19.C
new file mode 100644 (file)
index 0000000..c560b01
--- /dev/null
@@ -0,0 +1,23 @@
+// PR c++/18962
+
+template<class T1,int N1>
+class Class
+{
+public:
+  template <class T2,int N2>
+  void function( const Class<T2,N2>& );
+};
+
+template<>
+template<class T2,int N2>
+void Class<int,1>::function( const Class<T2,N2>& param ) 
+{
+  param; // make sure we use the argument list from the definition.
+}
+
+int main()
+{
+  Class<int,1> instance;
+  Class<char,2> param;
+  instance.function( param );
+}
diff --git a/libjava/testsuite/libjava.jni/iface.c b/libjava/testsuite/libjava.jni/iface.c
new file mode 100644 (file)
index 0000000..6d33dc0
--- /dev/null
@@ -0,0 +1,40 @@
+#include <stdlib.h>
+#include <stdio.h>
+#include <iface.h>
+
+void check (JNIEnv *);
+
+void check(JNIEnv *env)
+{
+  if ((*env)->ExceptionCheck(env) != JNI_FALSE)
+    {
+      fprintf(stderr, "UNEXPECTED EXCEPTION\n");
+      exit(-1);
+    }
+}
+
+void
+Java_iface_doCalls (JNIEnv *env, jobject self, jobject other)
+{
+  jclass iface_class, comparable_class;
+  jmethodID iface_meth, comparable_meth;
+  jvalue args[1];
+
+  iface_class = (*env)->FindClass(env, "iface");
+  check (env);
+  comparable_class = (*env)->FindClass (env, "mycomp");
+  check (env);
+
+  iface_meth = (*env)->GetMethodID (env, iface_class, "compareTo",
+                                   "(Ljava/lang/Object;)I");
+  check (env);
+  comparable_meth = (*env)->GetMethodID (env, comparable_class, "compareTo",
+                                        "(Ljava/lang/Object;)I");
+  check (env);
+
+  args[0].l = other;
+  (*env)->CallObjectMethodA (env, self, iface_meth, args);
+  check (env);
+  (*env)->CallObjectMethodA (env, self, comparable_meth, args);
+  check (env);
+}
diff --git a/libjava/testsuite/libjava.jni/iface.java b/libjava/testsuite/libjava.jni/iface.java
new file mode 100644 (file)
index 0000000..c878ae3
--- /dev/null
@@ -0,0 +1,27 @@
+// JNI calls via an interface method were broken in a couple releases.
+
+interface mycomp
+{
+  int compareTo(Object x);
+}
+
+public class iface implements mycomp
+{
+  static
+  {
+    System.loadLibrary("iface");
+  }
+
+  public int compareTo (Object x)
+  {
+    System.out.println ("hi maude");
+    return 3;
+  }
+
+  public native void doCalls(Object x);
+
+  public static void main (String[] args)
+  {
+    new iface().doCalls(args);
+  }
+}
diff --git a/libjava/testsuite/libjava.jni/iface.out b/libjava/testsuite/libjava.jni/iface.out
new file mode 100644 (file)
index 0000000..4eb3a1b
--- /dev/null
@@ -0,0 +1,2 @@
+hi maude
+hi maude