diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp index bd7c14c2c2d..d2092dc6670 100644 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -9834,7 +9834,7 @@ void Tokenizer::simplifyAsm() Token::eraseTokens(tok, tok->linkAt(1)->next()); } - else if (Token::Match(tok, "asm|__asm|__asm__ volatile|__volatile|__volatile__| (")) { + else if (Token::Match(tok, "asm|__asm|__asm__ volatile|__volatile|__volatile__|goto|inline| (")) { // Goto "(" Token *partok = tok->next(); if (partok->str() != "(") diff --git a/test/testtokenize.cpp b/test/testtokenize.cpp index 58724865896..88c68f47b17 100644 --- a/test/testtokenize.cpp +++ b/test/testtokenize.cpp @@ -1099,6 +1099,9 @@ class TestTokenizer : public TestFixture { ASSERT_EQUALS("asm ( \"mov ax , bx\" ) ; int a ;", tokenizeAndStringify("asm { mov ax,bx } int a;")); ASSERT_EQUALS("asm\n\n( \"mov ax , bx\" ) ;", tokenizeAndStringify("__asm\nmov ax,bx\n__endasm;")); ASSERT_EQUALS("asm\n\n( \"push b ; for if\" ) ;", tokenizeAndStringify("__asm\npush b ; for if\n__endasm;")); + ASSERT_EQUALS("asm ( \"\"mov ax , bx\"\" ) ;", tokenizeAndStringify("asm volatile (\"mov ax , bx\");")); + ASSERT_EQUALS("asm ( \"\"mov ax , bx\"\" ) ;", tokenizeAndStringify("asm goto (\"mov ax , bx\");")); + ASSERT_EQUALS("asm ( \"\"mov ax , bx\"\" ) ;", tokenizeAndStringify("asm inline (\"mov ax , bx\");")); // 'asm ( ) ;' should be in the same line ASSERT_EQUALS(";\n\nasm ( \"\"mov ax,bx\"\" ) ;", tokenizeAndStringify(";\n\n__asm__ volatile ( \"mov ax,bx\" );"));