v.g.vassilev added a comment. After landing https://reviews.llvm.org/D126682 we might be able to write a test in clang-repl such as:
cpp clang-repl> #include <iostream> clang-repl> #include <fstream> clang-repl>using namespace std; clang-repl> int write_str (const char* str) { ofstream myfile; myfile.open ("a.h"); myfile << str<<"\n"; myfile.close(); return 0; } clang-repl> auto r1 = write_str("int i = 42"); clang-repl> extern "C" int printf(const char*,...); clang-repl> #include "a.h" clang-repl> auto r2 = printf("i=%d\n", i); clang-repl>%undo clang-repl>%undo clang-repl> auto r3 = write_str("int i = 0"); clang-repl> #include "a.h" clang-repl> auto r2 = printf("i=%d\n", i); // Here we should print `i=0`. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D126266/new/ https://reviews.llvm.org/D126266 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits