forked from OSchip/llvm-project
Reject asm output constraints that consist of modifiers only.
Fixes PR15759. llvm-svn: 179756
This commit is contained in:
parent
1a6cfb46e5
commit
7ee3b9c0e4
|
@ -373,7 +373,7 @@ bool TargetInfo::validateOutputConstraint(ConstraintInfo &Info) const {
|
|||
Name++;
|
||||
}
|
||||
|
||||
return true;
|
||||
return Info.allowsMemory() || Info.allowsRegister();
|
||||
}
|
||||
|
||||
bool TargetInfo::resolveSymbolicName(const char *&Name,
|
||||
|
|
|
@ -130,3 +130,19 @@ void test14(struct S *s) {
|
|||
__asm("": : "a"(*s)); // expected-error {{dereference of pointer to incomplete type 'struct S'}}
|
||||
__asm("": "=a" (*s) :); // expected-error {{dereference of pointer to incomplete type 'struct S'}}
|
||||
}
|
||||
|
||||
// PR15759.
|
||||
double test15() {
|
||||
double ret = 0;
|
||||
__asm("0.0":"="(ret)); // expected-error {{invalid output constraint '=' in asm}}
|
||||
__asm("0.0":"=&"(ret)); // expected-error {{invalid output constraint '=&' in asm}}
|
||||
__asm("0.0":"+?"(ret)); // expected-error {{invalid output constraint '+?' in asm}}
|
||||
__asm("0.0":"+!"(ret)); // expected-error {{invalid output constraint '+!' in asm}}
|
||||
__asm("0.0":"+#"(ret)); // expected-error {{invalid output constraint '+#' in asm}}
|
||||
__asm("0.0":"+*"(ret)); // expected-error {{invalid output constraint '+*' in asm}}
|
||||
__asm("0.0":"=%"(ret)); // expected-error {{invalid output constraint '=%' in asm}}
|
||||
__asm("0.0":"=,="(ret)); // expected-error {{invalid output constraint '=,=' in asm}}
|
||||
__asm("0.0":"=,g"(ret)); // no-error
|
||||
__asm("0.0":"=g"(ret)); // no-error
|
||||
return ret;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue