Index: lib/Basic/TargetInfo.cpp =================================================================== --- lib/Basic/TargetInfo.cpp +++ lib/Basic/TargetInfo.cpp @@ -504,6 +504,7 @@ case '?': // Disparage slightly code. case '!': // Disparage severely. case '*': // Ignore for choosing register preferences. + case 'i': // Ignore i as output constraint (match from the other chars) break; // Pass them. } Index: test/Sema/asm.c =================================================================== --- test/Sema/asm.c +++ test/Sema/asm.c @@ -160,6 +160,17 @@ return ret; } +void iOutputConstraint(int x){ + __asm ("nop" : "=ir" (x) : :); // no-error + __asm ("nop" : "=ri" (x) : :); // no-error + __asm ("nop" : "=ig" (x) : :); // no-error + __asm ("nop" : "=im" (x) : :); // no-error + __asm ("nop" : "=imr" (x) : :); // no-error + __asm ("nop" : "=i" (x) : :); // expected-error{{invalid output constraint '=i' in asm}} + __asm ("nop" : "+i" (x) : :); // expected-error{{invalid output constraint '+i' in asm}} + __asm ("nop" : "=ii" (x) : :); // expected-error{{invalid output constraint '=ii' in asm}} +} + // PR19837 struct foo { int a;