blob: 210014b3cd2bed3c8e9d4eaf838c53b36cb6e86e [file] [log] [blame]
Gabor Marton1f667532018-05-24 08:41:07 +00001//===------ unittest/AST/Language.cpp - AST unit test support -------------===//
2//
Chandler Carruth2946cd72019-01-19 08:50:56 +00003// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
Gabor Marton1f667532018-05-24 08:41:07 +00006//
7//===----------------------------------------------------------------------===//
8//
9// This file defines language options for AST unittests.
10//
11//===----------------------------------------------------------------------===//
12
13#include "Language.h"
14
15namespace clang {
16namespace ast_matchers {
17
18ArgVector getBasicRunOptionsForLanguage(Language Lang) {
19 ArgVector BasicArgs;
20 // Test with basic arguments.
21 switch (Lang) {
22 case Lang_C:
23 BasicArgs = {"-x", "c", "-std=c99"};
24 break;
25 case Lang_C89:
26 BasicArgs = {"-x", "c", "-std=c89"};
27 break;
28 case Lang_CXX:
29 BasicArgs = {"-std=c++98", "-frtti"};
30 break;
31 case Lang_CXX11:
32 BasicArgs = {"-std=c++11", "-frtti"};
33 break;
34 case Lang_CXX14:
35 BasicArgs = {"-std=c++14", "-frtti"};
36 break;
37 case Lang_OpenCL:
38 case Lang_OBJCXX:
39 llvm_unreachable("Not implemented yet!");
40 }
41 return BasicArgs;
42}
43
Gabor Marton1f667532018-05-24 08:41:07 +000044} // end namespace ast_matchers
45} // end namespace clang