LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 20204 - clang-cl doesn't accept nested __asm statements
Summary: clang-cl doesn't accept nested __asm statements
Status: RESOLVED FIXED
Alias: None
Product: clang
Classification: Unclassified
Component: -New Bugs (show other bugs)
Version: trunk
Hardware: PC All
: P normal
Assignee: Ehsan Akhgari [:ehsan]
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-04 09:42 PDT by Ehsan Akhgari [:ehsan]
Modified: 2014-07-06 00:28 PDT (History)
6 users (show)

See Also:
Fixed By Commit(s):


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ehsan Akhgari [:ehsan] 2014-07-04 09:42:29 PDT
$ cat test.cpp
void f() {
  __asm {
    __asm {
      mov eax, 1
    }
  }
}

$ clang-cl -c test.cpp
test.cpp(3,5) :  error: unexpected token at start of statement
    __asm {
    ^
1 error generated.
Comment 1 Jeff Muizelaar 2014-07-04 10:35:25 PDT
FWIW, this idiom is used here:
http://dxr.mozilla.org/mozilla-central/source/media/libtheora/lib/x86_vc/mmxidct.c#131
Comment 2 Ehsan Akhgari [:ehsan] 2014-07-04 11:00:20 PDT
(In reply to comment #1)
> FWIW, this idiom is used here:
> http://dxr.mozilla.org/mozilla-central/source/media/libtheora/lib/x86_vc/
> mmxidct.c#131

Among elsewhere in libtheora.  This seems to be somewhat popular there.
Comment 3 Ehsan Akhgari [:ehsan] 2014-07-04 12:37:45 PDT
And libyuv too.
Comment 4 Ehsan Akhgari [:ehsan] 2014-07-05 14:51:36 PDT
Here is a fix: http://reviews.llvm.org/D4399
Comment 5 Ehsan Akhgari [:ehsan] 2014-07-06 00:28:03 PDT
Fixed in r212389.