plugin-vs-debug-info.cpp 922 B

1234567891011121314151617181920212223242526272829303132
  1. // This test uses PrintFunctionNames with -fdelayed-template-parsing because it
  2. // happens to use a RecursiveASTVisitor that forces deserialization of AST
  3. // files.
  4. //
  5. // RUN: %clang_cc1 -triple %itanium_abi_triple -fdelayed-template-parsing \
  6. // RUN: -std=c++14 -emit-pch -o %t.pch %s
  7. // RUN: %clang_cc1 -triple %itanium_abi_triple \
  8. // RUN: -load %llvmshlibdir/PrintFunctionNames%pluginext \
  9. // RUN: -add-plugin print-fns -std=c++14 -include-pch %t.pch %s -emit-llvm \
  10. // RUN: -fdelayed-template-parsing -debug-info-kind=limited \
  11. // RUN: -o %t.ll 2>&1 | FileCheck --check-prefix=DECLS %s
  12. // RUN: FileCheck --check-prefix=IR %s < %t.ll
  13. //
  14. // REQUIRES: plugins, examples
  15. // DECLS: top-level-decl: "func"
  16. // IR: define {{.*}}void @_Z4funcv()
  17. #ifndef HEADER
  18. #define HEADER
  19. struct nullopt_t {
  20. constexpr explicit nullopt_t(int) {}
  21. };
  22. constexpr nullopt_t nullopt(0);
  23. #else
  24. void func() { }
  25. #endif