[LLVMbugs] [Bug 13340] New: [Windows] Support MSVC __asm syntax

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Jul 12 01:02:36 PDT 2012


http://llvm.org/bugs/show_bug.cgi?id=13340

             Bug #: 13340
           Summary: [Windows] Support MSVC __asm syntax
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: timurrrr at google.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified


$ 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

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list