diff options
author | Jason Merrill <jason@gcc.gnu.org> | 1998-01-29 05:21:37 -0500 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 1998-01-29 05:21:37 -0500 |
commit | c25520e8b93f2c1e367dfb29c01dbffabf7b7762 (patch) | |
tree | ebdc8aa104ac541a5aa300bc3663e4aa1166a241 | |
parent | 31fa4410614b1a3fc9e418018cf63797a7662f27 (diff) | |
download | gcc-c25520e8b93f2c1e367dfb29c01dbffabf7b7762.tar.gz |
new
From-SVN: r17551
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.pt/alignof.C | 21 | ||||
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.pt/explicit66.C | 11 | ||||
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.pt/sizeof.C | 17 |
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(); +} |