diff options
author | Daniel Jasper <djasper@google.com> | 2013-03-14 13:45:21 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2013-03-14 13:45:21 +0000 |
commit | 923ebef120a37122ce50722a85cbe42c0c2dab53 (patch) | |
tree | 7ff105e2ffb5de8812a3e91e3e43f0e0dc574614 /unittests/Format/FormatTest.cpp | |
parent | 23219daa70d2e4735bc8660a86c80cac37824afe (diff) |
Basic support for formatting asm() statments.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177073 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Format/FormatTest.cpp')
-rw-r--r-- | unittests/Format/FormatTest.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp index 86b98b3152..af580ddce7 100644 --- a/unittests/Format/FormatTest.cpp +++ b/unittests/Format/FormatTest.cpp @@ -776,6 +776,16 @@ TEST_F(FormatTest, FormatsNamespaces) { TEST_F(FormatTest, FormatsExternC) { verifyFormat("extern \"C\" {\nint a;"); } +TEST_F(FormatTest, FormatsInlineASM) { + verifyFormat("asm(\"xyz\" : \"=a\"(a), \"=d\"(b) : \"a\"(data));"); + verifyFormat( + "asm(\"movq\\t%%rbx, %%rsi\\n\\t\"\n" + " \"cpuid\\n\\t\"\n" + " \"xchgq\\t%%rbx, %%rsi\\n\\t\"\n" + " : \"=a\" (*rEAX), \"=S\" (*rEBX), \"=c\" (*rECX), \"=d\" (*rEDX)\n" + " : \"a\"(value));"); +} + TEST_F(FormatTest, FormatTryCatch) { // FIXME: Handle try-catch explicitly in the UnwrappedLineParser, then we'll // also not create single-line-blocks. |