Reid Kleckner | 15241ba | 2016-11-30 00:25:36 +0000 | [diff] [blame^] | 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 -fdelayed-template-parsing -std=c++14 -emit-pch -o %t.pch %s |
| 6 | // RUN: %clang_cc1 -load %llvmshlibdir/PrintFunctionNames%pluginext \ |
| 7 | // RUN: -add-plugin print-fns -std=c++14 -include-pch %t.pch %s -emit-llvm \ |
| 8 | // RUN: -fdelayed-template-parsing -debug-info-kind=limited \ |
| 9 | // RUN: -o %t.ll 2>&1 | FileCheck --check-prefix=DECLS %s |
| 10 | // RUN: FileCheck --check-prefix=IR %s < %t.ll |
| 11 | // |
| 12 | // REQUIRES: plugins, examples |
| 13 | |
| 14 | // DECLS: top-level-decl: "func" |
| 15 | |
| 16 | // IR: define {{.*}}void @_Z4funcv() |
| 17 | |
| 18 | #ifndef HEADER |
| 19 | #define HEADER |
| 20 | |
| 21 | struct nullopt_t { |
| 22 | constexpr explicit nullopt_t(int) {} |
| 23 | }; |
| 24 | constexpr nullopt_t nullopt(0); |
| 25 | |
| 26 | #else |
| 27 | |
| 28 | void func() { } |
| 29 | |
| 30 | #endif |