diff options
author | Daniel Jasper <djasper@google.com> | 2015-01-12 10:14:56 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2015-01-12 10:14:56 +0000 |
commit | cd4fa1779103c10a487f2a9b7fe778b79ab299b4 (patch) | |
tree | e03406a92e2371bcd5f9d0ec3a9be417ae0be94c /unittests | |
parent | 0facee5f614db7d4328856cdab4e397dd703cc83 (diff) | |
download | clang-cd4fa1779103c10a487f2a9b7fe778b79ab299b4.tar.gz |
clang-format: Fix formatting of inline asm.
Specifically, adjust the leading "__asm {" and trailing "}" while still
leaving the assembly inside it alone.
This fixes llvm.org/PR22190.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225623 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests')
-rw-r--r-- | unittests/Format/FormatTest.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp index 3b3f5fb74c..a49a35c1de 100644 --- a/unittests/Format/FormatTest.cpp +++ b/unittests/Format/FormatTest.cpp @@ -2191,11 +2191,11 @@ TEST_F(FormatTest, FormatsInlineASM) { " : \"a\"(value));"); EXPECT_EQ( "void NS_InvokeByIndex(void *that, unsigned int methodIndex) {\n" - " __asm {\n" + " __asm {\n" " mov edx,[that] // vtable in edx\n" " mov eax,methodIndex\n" " call [edx][eax*4] // stdcall\n" - " }\n" + " }\n" "}", format("void NS_InvokeByIndex(void *that, unsigned int methodIndex) {\n" " __asm {\n" @@ -2204,6 +2204,10 @@ TEST_F(FormatTest, FormatsInlineASM) { " call [edx][eax*4] // stdcall\n" " }\n" "}")); + verifyFormat("void function() {\n" + " // comment\n" + " asm(\"\");\n" + "}"); } TEST_F(FormatTest, FormatTryCatch) { |