From c6366077ed8dafe40fbd04315bdec0450e84e087 Mon Sep 17 00:00:00 2001 From: Daniel Jasper Date: Sun, 10 May 2015 08:42:04 +0000 Subject: clang-format: Preserve line break before } in __asm { ... }. Some compilers ignore everything after a semicolon in such inline asm blocks and thus, the closing brace must not be moved to the previous line. llvm-svn: 236946 --- clang/unittests/Format/FormatTest.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'clang/unittests/Format/FormatTest.cpp') diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp index 6569badd035..ce14165bc88 100644 --- a/clang/unittests/Format/FormatTest.cpp +++ b/clang/unittests/Format/FormatTest.cpp @@ -2316,6 +2316,14 @@ TEST_F(FormatTest, FormatsInlineASM) { " call [edx][eax*4] // stdcall\n" " }\n" "}")); + EXPECT_EQ("_asm {\n" + " xor eax, eax;\n" + " cpuid;\n" + "}", + format("_asm {\n" + " xor eax, eax;\n" + " cpuid;\n" + "}")); verifyFormat("void function() {\n" " // comment\n" " asm(\"\");\n" -- cgit v1.2.3