Stefan =?utf-8?q?Gränitz?= <stefan.graen...@gmail.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/84...@github.com>


================
@@ -136,6 +136,24 @@ TEST(InterpreterTest, DeclsAndStatements) {
   EXPECT_TRUE(!!R2);
 }
 
+TEST(InterpreterTest, PTUStack) {
+  clang::IncrementalCompilerBuilder CB;
+  auto CI = cantFail(CB.CreateCpp());
+
+  llvm::Error Err = llvm::Error::success();
+  auto Interp = std::make_unique<Interpreter>(std::move(CI), Err);
+  cantFail(std::move(Err));
+
+  auto NumBuiltinPTUs = Interp->getEffectivePTUSize();
+  cantFail(Interp->Parse("void firstRuntimePTU() {}"));
+  EXPECT_EQ(NumBuiltinPTUs + 1, Interp->getEffectivePTUSize());
----------------
vgvassilev wrote:

Wouldn’t using the public interpreter::Undo indirectly achieve the same effect? 
If it errors out we will know the size of the builtin PTUs. 

https://github.com/llvm/llvm-project/pull/84176
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to