diff options
author | upstream source tree <ports@midipix.org> | 2015-03-15 20:14:05 -0400 |
---|---|---|
committer | upstream source tree <ports@midipix.org> | 2015-03-15 20:14:05 -0400 |
commit | 554fd8c5195424bdbcabf5de30fdc183aba391bd (patch) | |
tree | 976dc5ab7fddf506dadce60ae936f43f58787092 /gcc/testsuite/g++.dg/pch | |
download | cbb-gcc-4.6.4-upstream.tar.bz2 cbb-gcc-4.6.4-upstream.tar.xz |
obtained gcc-4.6.4.tar.bz2 from upstream website;upstream
verified gcc-4.6.4.tar.bz2.sig;
imported gcc-4.6.4 source tree from verified upstream tarball.
downloading a git-generated archive based on the 'upstream' tag
should provide you with a source tree that is binary identical
to the one extracted from the above tarball.
if you have obtained the source via the command 'git clone',
however, do note that line-endings of files in your working
directory might differ from line-endings of the respective
files in the upstream repository.
Diffstat (limited to 'gcc/testsuite/g++.dg/pch')
23 files changed, 159 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/pch/array-1.C b/gcc/testsuite/g++.dg/pch/array-1.C new file mode 100644 index 000000000..a8935ed26 --- /dev/null +++ b/gcc/testsuite/g++.dg/pch/array-1.C @@ -0,0 +1,15 @@ +// PR c++/36852 + +#include "array-1.H" + +template <class T> +T +A::foo (T t[3][3]) +{ + return t[0][1]; +} + +int +main () +{ +} diff --git a/gcc/testsuite/g++.dg/pch/array-1.Hs b/gcc/testsuite/g++.dg/pch/array-1.Hs new file mode 100644 index 000000000..fb44b675e --- /dev/null +++ b/gcc/testsuite/g++.dg/pch/array-1.Hs @@ -0,0 +1,4 @@ +struct A +{ + template <class T> static T foo (T[3][3]); +}; diff --git a/gcc/testsuite/g++.dg/pch/empty.C b/gcc/testsuite/g++.dg/pch/empty.C new file mode 100644 index 000000000..92b3cbcdc --- /dev/null +++ b/gcc/testsuite/g++.dg/pch/empty.C @@ -0,0 +1,5 @@ +#include "empty.H" +int main() +{ + return 0; +} diff --git a/gcc/testsuite/g++.dg/pch/empty.Hs b/gcc/testsuite/g++.dg/pch/empty.Hs new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/gcc/testsuite/g++.dg/pch/empty.Hs diff --git a/gcc/testsuite/g++.dg/pch/externc-1.C b/gcc/testsuite/g++.dg/pch/externc-1.C new file mode 100644 index 000000000..26ffb50a0 --- /dev/null +++ b/gcc/testsuite/g++.dg/pch/externc-1.C @@ -0,0 +1,6 @@ +#include "externc-1.H" + +template <typename X> struct foo +{ + X y; +}; diff --git a/gcc/testsuite/g++.dg/pch/externc-1.Hs b/gcc/testsuite/g++.dg/pch/externc-1.Hs new file mode 100644 index 000000000..21aaf7436 --- /dev/null +++ b/gcc/testsuite/g++.dg/pch/externc-1.Hs @@ -0,0 +1 @@ +#include <stddef.h> diff --git a/gcc/testsuite/g++.dg/pch/local-1.C b/gcc/testsuite/g++.dg/pch/local-1.C new file mode 100644 index 000000000..75847e5c1 --- /dev/null +++ b/gcc/testsuite/g++.dg/pch/local-1.C @@ -0,0 +1,6 @@ +#include "local-1.H" +int main() +{ + func<int> (); + return 0; +} diff --git a/gcc/testsuite/g++.dg/pch/local-1.Hs b/gcc/testsuite/g++.dg/pch/local-1.Hs new file mode 100644 index 000000000..56a6c7e47 --- /dev/null +++ b/gcc/testsuite/g++.dg/pch/local-1.Hs @@ -0,0 +1,7 @@ +template<typename T> void func() +{ + struct object + { + object() {} + }; +} diff --git a/gcc/testsuite/g++.dg/pch/pch.C b/gcc/testsuite/g++.dg/pch/pch.C new file mode 100644 index 000000000..9483efad0 --- /dev/null +++ b/gcc/testsuite/g++.dg/pch/pch.C @@ -0,0 +1,9 @@ +// { dg-options "-save-temps -fpch-preprocess -I." } + +#include "pch.H" +int main() +{ + return 0; +} + +// { dg-final { cleanup-saved-temps ".s" } } diff --git a/gcc/testsuite/g++.dg/pch/pch.Hs b/gcc/testsuite/g++.dg/pch/pch.Hs new file mode 100644 index 000000000..4bd8276f3 --- /dev/null +++ b/gcc/testsuite/g++.dg/pch/pch.Hs @@ -0,0 +1 @@ +// empty file diff --git a/gcc/testsuite/g++.dg/pch/pch.exp b/gcc/testsuite/g++.dg/pch/pch.exp new file mode 100644 index 000000000..209a6a52c --- /dev/null +++ b/gcc/testsuite/g++.dg/pch/pch.exp @@ -0,0 +1,39 @@ +# Copyright (C) 1997, 2002, 2003, 2007 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GCC; see the file COPYING3. If not see +# <http://www.gnu.org/licenses/>. + +# GCC testsuite for precompiled header interaction, +# that uses the `dg.exp' driver. + +# Load support procs. +load_lib "g++-dg.exp" +load_lib dg-pch.exp + +# Initialize `dg'. +dg-init + +set old_dg_do_what_default "${dg-do-what-default}" + +# Main loop. +foreach test [lsort [glob -nocomplain $srcdir/$subdir/*.C]] { + # We don't try to use the loop-optimizing options, since they are highly + # unlikely to make any difference to PCH. + dg-pch $subdir $test [list "-g" "-O2 -g" "-O2"] ".H" +} + +set dg-do-what-default "$old_dg_do_what_default" + +# All done. +dg-finish diff --git a/gcc/testsuite/g++.dg/pch/static-1.C b/gcc/testsuite/g++.dg/pch/static-1.C new file mode 100644 index 000000000..21e778982 --- /dev/null +++ b/gcc/testsuite/g++.dg/pch/static-1.C @@ -0,0 +1,10 @@ +#include "static-1.H" +int LocalStaticTest() +{ + static A sa; +} + +int main(int argc, char **argv) +{ + A::StaticTest(); +} diff --git a/gcc/testsuite/g++.dg/pch/static-1.Hs b/gcc/testsuite/g++.dg/pch/static-1.Hs new file mode 100644 index 000000000..d277b787b --- /dev/null +++ b/gcc/testsuite/g++.dg/pch/static-1.Hs @@ -0,0 +1,13 @@ +class A +{ +public: + int val; + + ~A() { + int i = 2; + } + + static void StaticTest() { + static A a; + } +}; diff --git a/gcc/testsuite/g++.dg/pch/system-1.C b/gcc/testsuite/g++.dg/pch/system-1.C new file mode 100644 index 000000000..72bea3c9a --- /dev/null +++ b/gcc/testsuite/g++.dg/pch/system-1.C @@ -0,0 +1,7 @@ +#include "system-1.H" + +int main() +{ + std::cout << "hello world!" << '\n'; + return 0; +} diff --git a/gcc/testsuite/g++.dg/pch/system-1.Hs b/gcc/testsuite/g++.dg/pch/system-1.Hs new file mode 100644 index 000000000..604782e4d --- /dev/null +++ b/gcc/testsuite/g++.dg/pch/system-1.Hs @@ -0,0 +1 @@ +#include <iostream> diff --git a/gcc/testsuite/g++.dg/pch/system-2.C b/gcc/testsuite/g++.dg/pch/system-2.C new file mode 100644 index 000000000..44f3ec018 --- /dev/null +++ b/gcc/testsuite/g++.dg/pch/system-2.C @@ -0,0 +1,7 @@ +#include "system-2.H" + +int main() +{ + std::cout << "hello world!" << std::endl; + return 0; +} diff --git a/gcc/testsuite/g++.dg/pch/system-2.Hs b/gcc/testsuite/g++.dg/pch/system-2.Hs new file mode 100644 index 000000000..13c79d104 --- /dev/null +++ b/gcc/testsuite/g++.dg/pch/system-2.Hs @@ -0,0 +1,2 @@ +#include <iostream> +#include <string> diff --git a/gcc/testsuite/g++.dg/pch/template-1.C b/gcc/testsuite/g++.dg/pch/template-1.C new file mode 100644 index 000000000..c1718a991 --- /dev/null +++ b/gcc/testsuite/g++.dg/pch/template-1.C @@ -0,0 +1,8 @@ +// PR c++/28217 + +#include "template-1.H" + +int +main (void) +{ +} diff --git a/gcc/testsuite/g++.dg/pch/template-1.Hs b/gcc/testsuite/g++.dg/pch/template-1.Hs new file mode 100644 index 000000000..afdb13f08 --- /dev/null +++ b/gcc/testsuite/g++.dg/pch/template-1.Hs @@ -0,0 +1,5 @@ +template<int> struct A +{ + enum { a, b = a }; + void foo(A<b>); +}; diff --git a/gcc/testsuite/g++.dg/pch/uninst.C b/gcc/testsuite/g++.dg/pch/uninst.C new file mode 100644 index 000000000..b7cd8bfc2 --- /dev/null +++ b/gcc/testsuite/g++.dg/pch/uninst.C @@ -0,0 +1,8 @@ +#include "uninst.H" + +template <class Type> void FOO() { } + +int main() { + FOO<char>(); // stage 2 needs this + return min<unsigned long>(5, 0); +} diff --git a/gcc/testsuite/g++.dg/pch/uninst.Hs b/gcc/testsuite/g++.dg/pch/uninst.Hs new file mode 100644 index 000000000..2f2b6dd3e --- /dev/null +++ b/gcc/testsuite/g++.dg/pch/uninst.Hs @@ -0,0 +1,2 @@ +#include <bits/stl_algobase.h> +using namespace std; diff --git a/gcc/testsuite/g++.dg/pch/wchar-1.C b/gcc/testsuite/g++.dg/pch/wchar-1.C new file mode 100644 index 000000000..6cb5fe15e --- /dev/null +++ b/gcc/testsuite/g++.dg/pch/wchar-1.C @@ -0,0 +1 @@ +#include "wchar-1.H" diff --git a/gcc/testsuite/g++.dg/pch/wchar-1.Hs b/gcc/testsuite/g++.dg/pch/wchar-1.Hs new file mode 100644 index 000000000..431908b88 --- /dev/null +++ b/gcc/testsuite/g++.dg/pch/wchar-1.Hs @@ -0,0 +1,2 @@ +#include <stddef.h> +const wchar_t test_var[] = L"wide string"; |