summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Merrill <jason@gcc.gnu.org>1998-01-29 05:21:37 -0500
committerJason Merrill <jason@gcc.gnu.org>1998-01-29 05:21:37 -0500
commitc25520e8b93f2c1e367dfb29c01dbffabf7b7762 (patch)
treeebdc8aa104ac541a5aa300bc3663e4aa1166a241
parent31fa4410614b1a3fc9e418018cf63797a7662f27 (diff)
downloadgcc-c25520e8b93f2c1e367dfb29c01dbffabf7b7762.tar.gz
new
From-SVN: r17551
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/alignof.C21
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/explicit66.C11
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/sizeof.C17
3 files changed, 49 insertions, 0 deletions
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
index 00000000000..0cfeed4084c
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.pt/alignof.C
@@ -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
index 00000000000..d4a3c627a97
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.pt/explicit66.C
@@ -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
index 00000000000..41915b30927
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.pt/sizeof.C
@@ -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();
+}