Fixed #4989 (False positive: Wrong processing of __asm block)
This commit is contained in:
parent
1ecade2657
commit
7fe51eb58b
|
@ -9456,7 +9456,7 @@ void Tokenizer::simplifyAsm()
|
|||
Token::eraseTokens(tok, tok->next()->link()->next());
|
||||
}
|
||||
|
||||
else if (Token::Match(tok, "asm|__asm|__asm__ volatile|__volatile__| (")) {
|
||||
else if (Token::Match(tok, "asm|__asm|__asm__ volatile|__volatile|__volatile__| (")) {
|
||||
// Goto "("
|
||||
Token *partok = tok->next();
|
||||
if (partok->str() != "(")
|
||||
|
|
|
@ -1132,6 +1132,7 @@ private:
|
|||
ASSERT_EQUALS("asm ( \"\"fnstcw %0\" : \"= m\" ( old_cw )\" ) ;", tokenizeAndStringify("asm volatile (\"fnstcw %0\" : \"= m\" (old_cw));"));
|
||||
ASSERT_EQUALS("asm ( \"\"fnstcw %0\" : \"= m\" ( old_cw )\" ) ;", tokenizeAndStringify(" __asm__ (\"fnstcw %0\" : \"= m\" (old_cw));"));
|
||||
ASSERT_EQUALS("asm ( \"\"ddd\"\" ) ;", tokenizeAndStringify(" __asm __volatile__ (\"ddd\") ;"));
|
||||
ASSERT_EQUALS("asm ( \"\"ddd\"\" ) ;", tokenizeAndStringify(" __asm __volatile (\"ddd\") ;"));
|
||||
ASSERT_EQUALS("asm ( \"\"mov ax,bx\"\" ) ;", tokenizeAndStringify("__asm__ volatile ( \"mov ax,bx\" );"));
|
||||
|
||||
// 'asm ( ) ;' should be in the same line
|
||||
|
|
Loading…
Reference in New Issue