Skip to content

[Windows] Support MSVC __asm syntax #13712

Closed
@timurrrr

Description

@timurrrr
Bugzilla Link 13340
Resolution FIXED
Resolved on Sep 21, 2015 22:07
Version trunk
OS Windows NT
Depends On llvm/llvm-bugzilla-archive#16830 llvm/llvm-bugzilla-archive#19861 llvm/llvm-bugzilla-archive#17201
Blocks llvm/llvm-bugzilla-archive#13707
CC @lattner,@DougGregor,@jrmuizel,@tritao,@nico,@rnk

Extended Description

$ cat assembly.cpp
int foo(int argument) {
int result;
__asm {
mov eax, argument
inc eax
mov result, eax
}
return result;
}

extern "C"
int printf(const char *fmt, ...);

int main() {
int val = 42;
int res = foo(val);
printf("res = %d\n", res);
return res != 43;
}

$ cl -nologo assembly.cpp && ./assembly.exe && echo "OK"
assembly.cpp
res = 43
OK

As of r159923,
$ clang++ -Xclang -cxx-abi -Xclang microsoft assembly.cpp && ./a.out && echo "OK"
assembly.cpp:3:3: warning: MS-style inline assembly is not supported [-Wmicrosoft]
__asm {
^
1 warning generated.
res = 11

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillac++

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions