summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang/lib/CodeGen/CGStmt.cpp5
-rw-r--r--clang/test/CodeGen/asm.c7
2 files changed, 12 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGStmt.cpp b/clang/lib/CodeGen/CGStmt.cpp
index a003e8ab9e8..d910f2fb969 100644
--- a/clang/lib/CodeGen/CGStmt.cpp
+++ b/clang/lib/CodeGen/CGStmt.cpp
@@ -1659,6 +1659,11 @@ SimplifyConstraint(const char *Constraint, const TargetInfo &Target,
while (Constraint[1] && Constraint[1] != ',')
Constraint++;
break;
+ case '&':
+ Result += '&';
+ while (Constraint[1] && Constraint[1] == '&')
+ Constraint++;
+ break;
case ',':
Result += "|";
break;
diff --git a/clang/test/CodeGen/asm.c b/clang/test/CodeGen/asm.c
index 5dbc01b1211..c64f83f7877 100644
--- a/clang/test/CodeGen/asm.c
+++ b/clang/test/CodeGen/asm.c
@@ -248,3 +248,10 @@ void t29(void) {
// CHECK: @t29
// CHECK: call void asm sideeffect "movl %eax, $0", "*m,~{dirflag},~{fpsr},~{flags}"([1 x i32]* @t29_var)
}
+
+void t30(int len) {
+ __asm__ volatile(""
+ : "+&&rm"(len));
+ // CHECK: @t30
+ // CHECK: call void asm sideeffect "", "=*&rm,0,~{dirflag},~{fpsr},~{flags}"
+}
OpenPOWER on IntegriCloud