Skip to content

Commit

Permalink
Use Backend_EmitMCNull for null codegen unit tests.
Browse files Browse the repository at this point in the history
Using Backend_EmitLL attemps to create a file with an empty filename.
This is problematic in certain environments: an empty filename may be
illegal, or the default output path may not be writable (in the case
where an empty filename would otherwise have some non-failing
semantics). This patch switches to use Backend_EmitMCNull, which
allows CodeGen to run, but does not attempt to create or write an
output file.

Differential Revision: http://reviews.llvm.org/D17405

llvm-svn: 261252
  • Loading branch information
dlj-NaN committed Feb 18, 2016
1 parent 6b2608f commit cd58bd6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion clang/unittests/Frontend/CodeGenActionTest.cpp
Expand Up @@ -26,7 +26,7 @@ namespace {
class NullCodeGenAction : public CodeGenAction {
public:
NullCodeGenAction(llvm::LLVMContext *_VMContext = nullptr)
: CodeGenAction(Backend_EmitLL, _VMContext) {}
: CodeGenAction(Backend_EmitMCNull, _VMContext) {}

// The action does not call methods of ATContext.
void ExecuteAction() override {
Expand Down

0 comments on commit cd58bd6

Please sign in to comment.