Tokenizer: improved handling of __asm__ in function declaration
This commit is contained in:
parent
16c6740520
commit
fab55287f7
|
@ -11425,6 +11425,11 @@ void Tokenizer::simplifyAsm()
|
||||||
else
|
else
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
if (Token::Match(tok->previous(), ") %name% %name% (")) {
|
||||||
|
tok->deleteThis();
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
// insert "asm ( "instruction" )"
|
// insert "asm ( "instruction" )"
|
||||||
tok->str("asm");
|
tok->str("asm");
|
||||||
if (tok->strAt(1) != ";" && tok->strAt(1) != "{")
|
if (tok->strAt(1) != ";" && tok->strAt(1) != "{")
|
||||||
|
|
|
@ -994,6 +994,8 @@ private:
|
||||||
|
|
||||||
// 'asm ( ) ;' should be in the same line
|
// 'asm ( ) ;' should be in the same line
|
||||||
ASSERT_EQUALS(";\n\nasm ( \"\"mov ax,bx\"\" ) ;", tokenizeAndStringify(";\n\n__asm__ volatile ( \"mov ax,bx\" );"));
|
ASSERT_EQUALS(";\n\nasm ( \"\"mov ax,bx\"\" ) ;", tokenizeAndStringify(";\n\n__asm__ volatile ( \"mov ax,bx\" );"));
|
||||||
|
|
||||||
|
ASSERT_EQUALS("void func1 ( ) ;", tokenizeAndStringify("void func1() __asm__(\"...\") __attribute__();"));
|
||||||
}
|
}
|
||||||
|
|
||||||
// #4725 - ^{}
|
// #4725 - ^{}
|
||||||
|
|
Loading…
Reference in New Issue