new
authorJason Merrill <jason@gcc.gnu.org>
Thu, 29 Jan 1998 10:21:37 +0000 (05:21 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Thu, 29 Jan 1998 10:21:37 +0000 (05:21 -0500)
From-SVN: r17551

gcc/testsuite/g++.old-deja/g++.pt/alignof.C [new file with mode: 0644]
gcc/testsuite/g++.old-deja/g++.pt/explicit66.C [new file with mode: 0644]
gcc/testsuite/g++.old-deja/g++.pt/sizeof.C [new file with mode: 0644]

diff --git a/gcc/testsuite/g++.old-deja/g++.pt/alignof.C b/gcc/testsuite/g++.old-deja/g++.pt/alignof.C
new file mode 100644 (file)
index 0000000..0cfeed4
--- /dev/null
@@ -0,0 +1,21 @@
+extern "C" void abort();
+
+struct S
+{
+  char c;
+  double d;
+};
+
+
+template <class T>
+void foo(T)
+{
+  if (__alignof__(T) != __alignof__(S))
+    abort();
+}
+
+
+int main()
+{
+  foo(S());
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/explicit66.C b/gcc/testsuite/g++.old-deja/g++.pt/explicit66.C
new file mode 100644 (file)
index 0000000..d4a3c62
--- /dev/null
@@ -0,0 +1,11 @@
+void f(int) {}
+void f(double);
+
+template <void (*fn)(int)>
+void foo() {}
+
+int main()
+{
+  foo<f>();
+}
+
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/sizeof.C b/gcc/testsuite/g++.old-deja/g++.pt/sizeof.C
new file mode 100644 (file)
index 0000000..41915b3
--- /dev/null
@@ -0,0 +1,17 @@
+extern "C" void abort();
+
+template <int I>
+int bar() { return I; }
+
+template <class T>
+int foo(T)
+{
+  return bar<sizeof(T) + 4>() + bar<sizeof(long) + 7>();
+}
+
+
+int main()
+{
+  if (foo(2) != sizeof(int) + 4 + sizeof(long) + 7)
+    abort();
+}