diff options
Diffstat (limited to 'clang-tools-extra/test/cpp11-migrate')
-rw-r--r-- | clang-tools-extra/test/cpp11-migrate/Combined/compilers.cpp | 63 | ||||
-rw-r--r-- | clang-tools-extra/test/cpp11-migrate/no_xform.cpp | 6 |
2 files changed, 63 insertions, 6 deletions
diff --git a/clang-tools-extra/test/cpp11-migrate/Combined/compilers.cpp b/clang-tools-extra/test/cpp11-migrate/Combined/compilers.cpp new file mode 100644 index 00000000000..14b29978693 --- /dev/null +++ b/clang-tools-extra/test/cpp11-migrate/Combined/compilers.cpp @@ -0,0 +1,63 @@ +// RUN: grep -Ev "// *[A-Z0-9-]+:" %s > %t.cpp +// RUN: cpp11-migrate -for-compilers=clang-2.9 %t.cpp -- -std=c++11 +// RUN: FileCheck -check-prefix=CLANG-29 -input-file=%t.cpp %s +// +// RUN: grep -Ev "// *[A-Z0-9-]+:" %s > %t.cpp +// RUN: cpp11-migrate -for-compilers=clang-2.9 -override-macros %t.cpp -- -std=c++11 +// RUN: FileCheck -check-prefix=CLANG-29-OV-MACROS -input-file=%t.cpp %s +// +// RUN: grep -Ev "// *[A-Z0-9-]+:" %s > %t.cpp +// RUN: cpp11-migrate -for-compilers=clang-3.0 %t.cpp -- -std=c++11 +// RUN: FileCheck -check-prefix=CLANG-30 -input-file=%t.cpp %s +// +// RUN: grep -Ev "// *[A-Z0-9-]+:" %s > %t.cpp +// RUN: cpp11-migrate -for-compilers=gcc-4.6 %t.cpp -- -std=c++11 +// RUN: FileCheck -check-prefix=GCC-46 -input-file=%t.cpp %s +// +// RUN: grep -Ev "// *[A-Z0-9-]+:" %s > %t.cpp +// RUN: cpp11-migrate -for-compilers=gcc-4.7 %t.cpp -- -std=c++11 +// RUN: FileCheck -check-prefix=GCC-47 -input-file=%t.cpp %s +// +// RUN: grep -Ev "// *[A-Z0-9-]+:" %s > %t.cpp +// RUN: cpp11-migrate -for-compilers=icc-13 %t.cpp -- -std=c++11 +// RUN: FileCheck -check-prefix=ICC-13 -input-file=%t.cpp %s +// +// RUN: grep -Ev "// *[A-Z0-9-]+:" %s > %t.cpp +// RUN: cpp11-migrate -for-compilers=icc-14 %t.cpp -- -std=c++11 +// RUN: FileCheck -check-prefix=ICC-14 -input-file=%t.cpp %s +// +// RUN: grep -Ev "// *[A-Z0-9-]+:" %s > %t.cpp +// RUN: cpp11-migrate -for-compilers=msvc-8 %t.cpp -- -std=c++11 +// RUN: FileCheck -check-prefix=MSVC-8 -input-file=%t.cpp %s +// +// Test multiple compilers +// RUN: grep -Ev "// *[A-Z0-9-]+:" %s > %t.cpp +// RUN: cpp11-migrate -for-compilers=clang-3.0,gcc-4.6,gcc-4.7 %t.cpp -- -std=c++11 +// RUN: FileCheck -check-prefix=MULTIPLE -input-file=%t.cpp %s +// +// Test unknown platform +// RUN: not cpp11-migrate -for-compilers=foo-10 %t.cpp -- -std=c++11 +// +// Test when no transforms can be selected because the compiler lacks support of +// the needed C++11 features +// RUN: not cpp11-migrate -for-compilers=clang-2.0 %t.cpp -- -std=c++11 + +// Test add overrides +struct A { + virtual A *clone() = 0; +}; + +#define LLVM_OVERRIDE override + +struct B : A { + virtual B *clone(); + // CLANG-29-OV-MACROS: virtual B *clone() LLVM_OVERRIDE; + // CLANG-29: virtual B *clone(); + // CLANG-30: virtual B *clone() override; + // GCC-46: virtual B *clone(); + // GCC-47: virtual B *clone() override; + // ICC-13: virtual B *clone(); + // ICC-14: virtual B *clone() override; + // MSVC-8: virtual B *clone() override; + // MULTIPLE: virtual B *clone(); +}; diff --git a/clang-tools-extra/test/cpp11-migrate/no_xform.cpp b/clang-tools-extra/test/cpp11-migrate/no_xform.cpp deleted file mode 100644 index 2845e3f9f44..00000000000 --- a/clang-tools-extra/test/cpp11-migrate/no_xform.cpp +++ /dev/null @@ -1,6 +0,0 @@ -// RUN: grep -Ev "// *[A-Z-]+:" %s > %t.cpp -// RUN: not cpp11-migrate %t.cpp -- - -int main(int argc, char** argv) { - return 0; -} |