Files
clang-p2996/clang/unittests/AST/Language.cpp
Gabor Marton 19f4f392c2 [ASTImporter] Add ms compatibility to tests which use the TestBase
Summary:
In order to avoid build failures on MS, we use -fms-compatibility too in
the tests which use the TestBase.  Moved the family of `testImport`
functions under a test fixture class, so we can use parameterized tests.
Refactored `testImport` and `testImportSequence`, because `for` loops over
the different compiler options is no longer needed, that is handeld by
the test framework via parameters from now on.

Reviewers: a.sidorin, r.stahl, xazax.hun

Subscribers: rnkovacs, dkrupp, cfe-commits

Differential Revision: https://reviews.llvm.org/D47367

llvm-svn: 335464
2018-06-25 13:04:37 +00:00

47 lines
1.2 KiB
C++

//===------ unittest/AST/Language.cpp - AST unit test support -------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file defines language options for AST unittests.
//
//===----------------------------------------------------------------------===//
#include "Language.h"
namespace clang {
namespace ast_matchers {
ArgVector getBasicRunOptionsForLanguage(Language Lang) {
ArgVector BasicArgs;
// Test with basic arguments.
switch (Lang) {
case Lang_C:
BasicArgs = {"-x", "c", "-std=c99"};
break;
case Lang_C89:
BasicArgs = {"-x", "c", "-std=c89"};
break;
case Lang_CXX:
BasicArgs = {"-std=c++98", "-frtti"};
break;
case Lang_CXX11:
BasicArgs = {"-std=c++11", "-frtti"};
break;
case Lang_CXX14:
BasicArgs = {"-std=c++14", "-frtti"};
break;
case Lang_OpenCL:
case Lang_OBJCXX:
llvm_unreachable("Not implemented yet!");
}
return BasicArgs;
}
} // end namespace ast_matchers
} // end namespace clang