]> granicus.if.org Git - clang/commit
[CodeGen]: fix error message for "=r" asm constraint
authorAlexander Potapenko <glider@google.com>
Fri, 30 Aug 2019 08:58:46 +0000 (08:58 +0000)
committerAlexander Potapenko <glider@google.com>
Fri, 30 Aug 2019 08:58:46 +0000 (08:58 +0000)
commit99b2bc4f952874990519d75bb61631959f8fd6c1
tree28813202d9bef19ce1cf8d5d63275d4682e6209d
parent145272e6be4c7ba738c9795fd19b5ca68702c097
[CodeGen]: fix error message for "=r" asm constraint

Summary:
Nico Weber reported that the following code:
  char buf[9];
  asm("" : "=r" (buf));

yields the "impossible constraint in asm: can't store struct into a register"
error message, although |buf| is not a struct (see
http://crbug.com/999160).

Make the error message more generic and add a test for it.
Also make sure other tests in x86_64-PR42672.c check for the full error
message.

Reviewers: eli.friedman, thakis

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D66948

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@370444 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/CGStmt.cpp
test/CodeGen/x86_64-PR42672.c