Browse Source

[spirv] Fix effcee error message check name and file name (#756)

Lei Zhang 7 years ago
parent
commit
2a15ef6914
1 changed files with 10 additions and 4 deletions
  1. 10 4
      tools/clang/unittests/SPIRV/FileTestFixture.cpp

+ 10 - 4
tools/clang/unittests/SPIRV/FileTestFixture.cpp

@@ -83,16 +83,22 @@ void FileTest::runFileTest(llvm::StringRef filename, bool expectSuccess,
     ASSERT_TRUE(utils::disassembleSpirvBinary(
         generatedBinary, &generatedSpirvAsm, true /* generateHeader */));
 
+    auto options = effcee::Options()
+                       .SetChecksName(filename.str())
+                       .SetInputName("<codegen>");
+
     // Run CHECK commands via effcee on disassembly.
-    result = effcee::Match(generatedSpirvAsm, checkCommands,
-                           effcee::Options().SetInputName(filename.str()));
+    result = effcee::Match(generatedSpirvAsm, checkCommands, options);
 
   } else {
     ASSERT_FALSE(compileOk);
 
+    auto options = effcee::Options()
+                       .SetChecksName(filename.str())
+                       .SetInputName("<message>");
+
     // Run CHECK commands via effcee on error messages.
-    result = effcee::Match(errorMessages, checkCommands,
-                           effcee::Options().SetInputName("<error-message>"));
+    result = effcee::Match(errorMessages, checkCommands, options);
   }
 
   // Print effcee's error message (if any).