From 15f7dc46e45a3f96978463d058307c01c0fcf8d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludvig=20Gunne=20Lindstr=C3=B6m?= Date: Thu, 25 Sep 2025 17:52:37 +0200 Subject: [PATCH 1/2] update test --- test/testtokenize.cpp | 3 +++ 1 file changed, 3 insertions(+) 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\" );")); From 9209db0a5764499abc28a63de2b89ac894d89602 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludvig=20Gunne=20Lindstr=C3=B6m?= Date: Thu, 25 Sep 2025 17:52:29 +0200 Subject: [PATCH 2/2] fix #14157 --- lib/tokenize.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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() != "(")