1 //===--- CommandLineArgs.cpp ----------------------------------------------===//
2 //
3 // 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
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #include "clang/Testing/CommandLineArgs.h"
10 #include "llvm/Support/ErrorHandling.h"
11 
12 namespace clang {
13 
14 std::vector<std::string> getCommandLineArgsForTesting(TestLanguage Lang) {
15   std::vector<std::string> Args;
16   // Test with basic arguments.
17   switch (Lang) {
18   case Lang_C:
19     Args = {"-x", "c", "-std=c99"};
20     break;
21   case Lang_C89:
22     Args = {"-x", "c", "-std=c89"};
23     break;
24   case Lang_CXX:
25     Args = {"-std=c++98", "-frtti"};
26     break;
27   case Lang_CXX11:
28     Args = {"-std=c++11", "-frtti"};
29     break;
30   case Lang_CXX14:
31     Args = {"-std=c++14", "-frtti"};
32     break;
33   case Lang_CXX17:
34     Args = {"-std=c++17", "-frtti"};
35     break;
36   case Lang_CXX2a:
37     Args = {"-std=c++2a", "-frtti"};
38     break;
39   case Lang_OBJCXX:
40     Args = {"-x", "objective-c++", "-frtti"};
41     break;
42   case Lang_OpenCL:
43     llvm_unreachable("Not implemented yet!");
44   }
45   return Args;
46 }
47 
48 } // end namespace clang
49