Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0 |
Maciej S. Szmigiero | d800777 | 2019-12-28 18:13:13 +0100 | [diff] [blame] | 2 | #include "clang/Basic/Version.h" |
| 3 | #if CLANG_VERSION_MAJOR < 8 |
Wang Nan | c7fb4f6 | 2016-11-26 07:03:32 +0000 | [diff] [blame] | 4 | #include "clang/Basic/VirtualFileSystem.h" |
Maciej S. Szmigiero | d800777 | 2019-12-28 18:13:13 +0100 | [diff] [blame] | 5 | #endif |
Wang Nan | c7fb4f6 | 2016-11-26 07:03:32 +0000 | [diff] [blame] | 6 | #include "clang/Driver/Driver.h" |
| 7 | #include "clang/Frontend/TextDiagnosticPrinter.h" |
| 8 | #include "llvm/ADT/IntrusiveRefCntPtr.h" |
| 9 | #include "llvm/Support/ManagedStatic.h" |
Maciej S. Szmigiero | d800777 | 2019-12-28 18:13:13 +0100 | [diff] [blame] | 10 | #if CLANG_VERSION_MAJOR >= 8 |
| 11 | #include "llvm/Support/VirtualFileSystem.h" |
| 12 | #endif |
Wang Nan | c7fb4f6 | 2016-11-26 07:03:32 +0000 | [diff] [blame] | 13 | #include "llvm/Support/raw_ostream.h" |
| 14 | |
| 15 | using namespace clang; |
| 16 | using namespace clang::driver; |
| 17 | |
| 18 | int main() |
| 19 | { |
| 20 | IntrusiveRefCntPtr<DiagnosticIDs> DiagID(new DiagnosticIDs()); |
| 21 | IntrusiveRefCntPtr<DiagnosticOptions> DiagOpts = new DiagnosticOptions(); |
| 22 | |
| 23 | DiagnosticsEngine Diags(DiagID, &*DiagOpts); |
| 24 | Driver TheDriver("test", "bpf-pc-linux", Diags); |
| 25 | |
| 26 | llvm::llvm_shutdown(); |
| 27 | return 0; |
| 28 | } |