Lines Matching refs:Interp
48 std::unique_ptr<Interpreter> Interp = createInterpreter(); in TEST() local
52 PTU &R1(cantFail(Interp->Parse("void g(); void g() {}"))); in TEST()
55 PTU &R2(cantFail(Interp->Parse("int i;"))); in TEST()
64 std::unique_ptr<Interpreter> Interp = createInterpreter(); in TEST() local
65 auto R1 = Interp->Parse("int var1 = 42; int f() { return var1; }"); in TEST()
73 auto R2 = Interp->Parse("int var2 = f();"); in TEST()
89 auto Interp = createInterpreter(ExtraArgs, DiagPrinter.get()); in TEST() local
90 auto Err = Interp->Parse("intentional_error v1 = 42; ").takeError(); in TEST()
96 auto RecoverErr = Interp->Parse("int var1 = 42;"); in TEST()
112 auto Interp = createInterpreter(ExtraArgs, DiagPrinter.get()); in TEST() local
113 auto R1 = Interp->Parse( in TEST()
122 auto R2 = Interp->Parse("var1++; printf(\"var1 value %d\\n\", var1);"); in TEST()
140 auto Interp = createInterpreter(ExtraArgs, DiagPrinter.get()); in TEST() local
143 auto Err1 = Interp->Undo(); in TEST()
146 auto Err2 = Interp->Parse("int foo = 42;"); in TEST()
148 auto Err3 = Interp->Undo(2); in TEST()
153 auto Err4 = Interp->Parse("int x = 42;"); in TEST()
155 auto Err5 = Interp->Undo(); in TEST()
157 auto Err6 = Interp->Parse("int x = 24;"); in TEST()
159 auto Err7 = Interp->Parse("#define X 42"); in TEST()
161 auto Err8 = Interp->Undo(); in TEST()
163 auto Err9 = Interp->Parse("#define X 24"); in TEST()
167 auto Err10 = Interp->Parse("int y = ;"); in TEST()
170 auto Err11 = Interp->Parse("int y = 42;"); in TEST()
172 auto Err12 = Interp->Undo(); in TEST()
199 std::unique_ptr<Interpreter> Interp = createInterpreter(); local
201 auto &PTU(cantFail(Interp->Parse("int f(const char*) {return 0;}")));
207 if (llvm::Error Err = Interp->Execute(PTU)) {
214 auto Addr = cantFail(Interp->getSymbolAddress(MangledName));
217 EXPECT_EQ(Addr, cantFail(Interp->getSymbolAddress(GD)));
220 static void *AllocateObject(TypeDecl *TD, Interpreter &Interp) { argument
223 clang::ASTContext &C = Interp.getCompilerInstance()->getASTContext();
236 auto R = Interp.ParseAndExecute(SS.str());
245 static NamedDecl *LookupSingleName(Interpreter &Interp, const char *Name) { argument
246 Sema &SemaRef = Interp.getCompilerInstance()->getSema();
264 std::unique_ptr<Interpreter> Interp = createInterpreter(Args); local
266 llvm::cantFail(Interp->Parse("void* operator new(__SIZE_TYPE__, void* __p);"
273 auto &PTU = llvm::cantFail(Interp->Parse("auto _t = &B::callme<A*>;"));
278 if (llvm::Error Err = Interp->Execute(PTU)) {
284 TypeDecl *TD = cast<TypeDecl>(LookupSingleName(*Interp, "A"));
285 void *NewA = AllocateObject(TD, *Interp);
294 auto fn = (TemplateSpecFn)cantFail(Interp->getSymbolAddress(MangledName));