diff options
-rw-r--r-- | lib/CodeGen/CGStmt.cpp | 5 | ||||
-rw-r--r-- | test/CodeGen/asm.c | 8 |
2 files changed, 9 insertions, 4 deletions
diff --git a/lib/CodeGen/CGStmt.cpp b/lib/CodeGen/CGStmt.cpp index 1aa62e7e03..1ada5ba419 100644 --- a/lib/CodeGen/CGStmt.cpp +++ b/lib/CodeGen/CGStmt.cpp @@ -707,8 +707,6 @@ static std::string ConvertAsmString(const AsmStmt& S, bool &Failed) { std::string Result; - unsigned NumOperands = S.getNumOutputs() + S.getNumInputs(); - while (1) { // Done with the string? if (StrStart == StrEnd) @@ -754,7 +752,8 @@ static std::string ConvertAsmString(const AsmStmt& S, bool &Failed) { StrStart = End; // FIXME: This should be caught during Sema. - assert(N < NumOperands && "Operand number out of range!"); + //unsigned NumOperands = S.getNumOutputs() + S.getNumInputs(); + //assert(N < NumOperands && "Operand number out of range!"); if (Modifier == '\0') Result += '$' + llvm::utostr(N); diff --git a/test/CodeGen/asm.c b/test/CodeGen/asm.c index 99655f8bb7..d6030a64ba 100644 --- a/test/CodeGen/asm.c +++ b/test/CodeGen/asm.c @@ -28,7 +28,7 @@ void t6(void) { __asm__ volatile("" : : "i" (t6)); } -// RUN: grep "T7 NAMED: \$2" %t +// RUN: grep "T7 NAMED: \$2" %t && void t7(int a) { __asm__ volatile("T7 NAMED: %[input]" : "+r"(a): [input] "i" (4)); } @@ -37,3 +37,9 @@ void t7(int a) { void t8() { __asm__ volatile("T8 NAMED MODIFIER: %c[input]" :: [input] "i" (4)); } + +// PR3682 +unsigned t9(unsigned int a) { + asm("bswap %0 %1" : "+r" (a)); + return a; +} |