aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Sema/SemaStmtAsm.cpp4
-rw-r--r--test/CodeGen/x86_32-inline-asm.c9
2 files changed, 11 insertions, 2 deletions
diff --git a/lib/Sema/SemaStmtAsm.cpp b/lib/Sema/SemaStmtAsm.cpp
index 3e9606e467..95964e20a7 100644
--- a/lib/Sema/SemaStmtAsm.cpp
+++ b/lib/Sema/SemaStmtAsm.cpp
@@ -181,7 +181,9 @@ StmtResult Sema::ActOnGCCAsmStmt(SourceLocation AsmLoc, bool IsSimple,
InputConstraintInfos.push_back(Info);
const Type *Ty = Exprs[i]->getType().getTypePtr();
- if (Ty->isDependentType() || Ty->isIncompleteType())
+ if (Ty->isDependentType() ||
+ RequireCompleteType(InputExpr->getLocStart(),
+ Exprs[i]->getType(), 0))
continue;
unsigned Size = Context.getTypeSize(Ty);
diff --git a/test/CodeGen/x86_32-inline-asm.c b/test/CodeGen/x86_32-inline-asm.c
index 527ad85581..aebc4e4a06 100644
--- a/test/CodeGen/x86_32-inline-asm.c
+++ b/test/CodeGen/x86_32-inline-asm.c
@@ -7,7 +7,7 @@ typedef u_int32_t uint32_t;
typedef unsigned long long u_int64_t;
typedef u_int64_t uint64_t;
-int func() {
+int func1() {
// Error out if size is > 32-bits.
uint32_t msr = 0x8b;
uint64_t val = 0;
@@ -22,3 +22,10 @@ int func() {
unsigned int port;
__asm__ volatile("outb %0, %w1" : : "a" (data), "Nd" (port)); // No error expected.
}
+
+struct S;
+void func2(struct S *s) {
+ __asm__ volatile(""
+ :
+ : "a" (*s));
+}