aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/CodeGen/CGStmt.cpp11
-rw-r--r--test/CodeGen/asm.c12
2 files changed, 16 insertions, 7 deletions
diff --git a/lib/CodeGen/CGStmt.cpp b/lib/CodeGen/CGStmt.cpp
index 008a480b9c..a889e55a9e 100644
--- a/lib/CodeGen/CGStmt.cpp
+++ b/lib/CodeGen/CGStmt.cpp
@@ -915,18 +915,17 @@ void CodeGenFunction::EmitAsmStmt(const AsmStmt &S) {
for (unsigned i = 0, e = S.getNumOutputs(); i != e; i++) {
TargetInfo::ConstraintInfo Info(S.getOutputConstraint(i),
S.getOutputName(i));
- assert(Target.validateOutputConstraint(Info) &&
- "Failed to parse output constraint");
+ bool IsValid = Target.validateOutputConstraint(Info); (void)IsValid;
+ assert(IsValid && "Failed to parse output constraint");
OutputConstraintInfos.push_back(Info);
}
for (unsigned i = 0, e = S.getNumInputs(); i != e; i++) {
TargetInfo::ConstraintInfo Info(S.getInputConstraint(i),
S.getInputName(i));
- assert(Target.validateInputConstraint(OutputConstraintInfos.data(),
- S.getNumOutputs(),
- Info) &&
- "Failed to parse input constraint");
+ bool IsValid = Target.validateInputConstraint(OutputConstraintInfos.data(),
+ S.getNumOutputs(), Info);
+ assert(IsValid && "Failed to parse input constraint"); (void)IsValid;
InputConstraintInfos.push_back(Info);
}
diff --git a/test/CodeGen/asm.c b/test/CodeGen/asm.c
index df593d79fa..fe9ca9a4c7 100644
--- a/test/CodeGen/asm.c
+++ b/test/CodeGen/asm.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple i386-unknown-unknown -emit-llvm %s -o %t
+// RUN: %clang_cc1 -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck %s
void t1(int len) {
__asm__ volatile("" : "=&r"(len), "+&r"(len));
}
@@ -110,3 +110,13 @@ int t16() {
);
return 0;
}
+
+// PR6475
+void t17() {
+ int i;
+ __asm__ ( "nop": "=m"(i));
+
+// CHECK: @t17()
+// CHECK: call void asm "nop", "=*m,
+}
+