Fixed #4989 (False positive: Wrong processing of __asm block)

This commit is contained in:
Daniel Marjamäki 2013-11-13 06:04:00 +01:00
parent 1ecade2657
commit 7fe51eb58b
2 changed files with 2 additions and 1 deletions

View File

@ -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() != "(")

View File

@ -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