[X86][MS-InlineAsm] Add constraint *m for memory access w/ global var
authorShengchen Kan <shengchen.kan@intel.com>
Wed, 3 Nov 2021 08:52:55 +0000 (16:52 +0800)
committerShengchen Kan <shengchen.kan@intel.com>
Fri, 5 Nov 2021 01:11:41 +0000 (09:11 +0800)
commitbe08e452f36602cd73f816787bf16d1a0405ff09
treeb2b3d45d6462ab0113ebbbc59737093057adf032
parent0bce3e3b843f205e085b635c0e1ebc28c5c6d708
[X86][MS-InlineAsm] Add constraint *m for memory access w/ global var

Constraint `*m` should be used when the address of a variable is passed
as a value. And the constraint is missing for MS inline assembly when sth
is written to the address of the variable.

The missing would cause FE delete the definition of the static varible,
and then result in "undefined reference to xxx" issue.

Reviewed By: xiangzhangllvm

Differential Revision: https://reviews.llvm.org/D113096
clang/test/CodeGen/X86/ms_fmul.c
clang/test/CodeGen/ms-inline-asm-static-variable.c [new file with mode: 0644]
clang/test/CodeGen/ms-inline-asm-variables.c
llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
llvm/test/CodeGen/X86/ms-inline-asm-array.ll [new file with mode: 0644]