test-clang.cpp 588 B

123456789101112131415161718192021
  1. #include "clang/Basic/VirtualFileSystem.h"
  2. #include "clang/Driver/Driver.h"
  3. #include "clang/Frontend/TextDiagnosticPrinter.h"
  4. #include "llvm/ADT/IntrusiveRefCntPtr.h"
  5. #include "llvm/Support/ManagedStatic.h"
  6. #include "llvm/Support/raw_ostream.h"
  7. using namespace clang;
  8. using namespace clang::driver;
  9. int main()
  10. {
  11. IntrusiveRefCntPtr<DiagnosticIDs> DiagID(new DiagnosticIDs());
  12. IntrusiveRefCntPtr<DiagnosticOptions> DiagOpts = new DiagnosticOptions();
  13. DiagnosticsEngine Diags(DiagID, &*DiagOpts);
  14. Driver TheDriver("test", "bpf-pc-linux", Diags);
  15. llvm::llvm_shutdown();
  16. return 0;
  17. }