diff options
-rw-r--r-- | lib/Target/JSBackend/CallHandlers.h | 4 | ||||
-rw-r--r-- | lib/Transforms/NaCl/PNaClABISimplify.cpp | 2 | ||||
-rw-r--r-- | test/CodeGen/JS/asm.ll | 13 |
3 files changed, 18 insertions, 1 deletions
diff --git a/lib/Target/JSBackend/CallHandlers.h b/lib/Target/JSBackend/CallHandlers.h index eefe491d16..bfdd86571c 100644 --- a/lib/Target/JSBackend/CallHandlers.h +++ b/lib/Target/JSBackend/CallHandlers.h @@ -1034,7 +1034,9 @@ void setupCallHandlers() { std::string handleCall(const Instruction *CI) { const Value *CV = getActuallyCalledValue(CI); - assert(!isa<InlineAsm>(CV) && "asm() not supported, use EM_ASM() (see emscripten.h)"); + if (isa<InlineAsm>(CV)) { + report_fatal_error("asm() not supported, use EM_ASM() (see emscripten.h)"); + } // Get the name to call this function by. If it's a direct call, meaning // which know which Function we're calling, avoid calling getValueAsStr, as diff --git a/lib/Transforms/NaCl/PNaClABISimplify.cpp b/lib/Transforms/NaCl/PNaClABISimplify.cpp index 4deee01a2b..27dd45e1ea 100644 --- a/lib/Transforms/NaCl/PNaClABISimplify.cpp +++ b/lib/Transforms/NaCl/PNaClABISimplify.cpp @@ -138,7 +138,9 @@ void llvm::PNaClABISimplifyAddPostOptPasses(PassManager &PM) { // Remove ``asm("":::"memory")``. This must occur after rewriting // atomics: a ``fence seq_cst`` surrounded by ``asm("":::"memory")`` // has special meaning and is translated differently. +#if 0 // XXX EMSCRIPTEN: asm("":::"memory") does't have special semantics. PM.add(createRemoveAsmMemoryPass()); +#endif #if 0 // XXX EMSCRIPTEN: PNaCl replaces pointers with ints to simplify their ABI; empscripten doesn't need this. // ReplacePtrsWithInts assumes that getelementptr instructions and // ConstantExprs have already been expanded out. diff --git a/test/CodeGen/JS/asm.ll b/test/CodeGen/JS/asm.ll new file mode 100644 index 0000000000..41a30431da --- /dev/null +++ b/test/CodeGen/JS/asm.ll @@ -0,0 +1,13 @@ +; RUN: not llc -march=js < %s + +; Inline asm isn't supported (yet?). llc should report an error when it +; encounters inline asm. +; +; We could support the special case of an empty inline asm string without much +; work, but code that uses such things most likely isn't portable anyway, and +; there are usually much better alternatives. + +define void @foo() { + call void asm "", ""() + ret void +} |