diff options
Diffstat (limited to 'unittests/IR/PassManagerTest.cpp')
-rw-r--r-- | unittests/IR/PassManagerTest.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/unittests/IR/PassManagerTest.cpp b/unittests/IR/PassManagerTest.cpp index 15b29d9b896..3bfe22cf646 100644 --- a/unittests/IR/PassManagerTest.cpp +++ b/unittests/IR/PassManagerTest.cpp @@ -153,30 +153,30 @@ struct TestInvalidationFunctionPass StringRef Name; }; -std::unique_ptr<Module> parseIR(const char *IR) { - LLVMContext &C = getGlobalContext(); +std::unique_ptr<Module> parseIR(LLVMContext &Context, const char *IR) { SMDiagnostic Err; - return parseAssemblyString(IR, Err, C); + return parseAssemblyString(IR, Err, Context); } class PassManagerTest : public ::testing::Test { protected: + LLVMContext Context; std::unique_ptr<Module> M; public: PassManagerTest() - : M(parseIR("define void @f() {\n" - "entry:\n" - " call void @g()\n" - " call void @h()\n" - " ret void\n" - "}\n" - "define void @g() {\n" - " ret void\n" - "}\n" - "define void @h() {\n" - " ret void\n" - "}\n")) {} + : M(parseIR(Context, "define void @f() {\n" + "entry:\n" + " call void @g()\n" + " call void @h()\n" + " ret void\n" + "}\n" + "define void @g() {\n" + " ret void\n" + "}\n" + "define void @h() {\n" + " ret void\n" + "}\n")) {} }; TEST_F(PassManagerTest, BasicPreservedAnalyses) { |