Tokenizer: handle when __asm__ directive is provided for function
This commit is contained in:
parent
47c7287b8d
commit
f25b8cf662
|
@ -11425,6 +11425,11 @@ void Tokenizer::simplifyAsm()
|
|||
else
|
||||
continue;
|
||||
|
||||
if (Token::simpleMatch(tok->previous(), ")")) {
|
||||
tok->deleteThis();
|
||||
continue;
|
||||
}
|
||||
|
||||
// insert "asm ( "instruction" )"
|
||||
tok->str("asm");
|
||||
if (tok->strAt(1) != ";" && tok->strAt(1) != "{")
|
||||
|
|
|
@ -994,6 +994,8 @@ private:
|
|||
|
||||
// 'asm ( ) ;' should be in the same line
|
||||
ASSERT_EQUALS(";\n\nasm ( \"\"mov ax,bx\"\" ) ;", tokenizeAndStringify(";\n\n__asm__ volatile ( \"mov ax,bx\" );"));
|
||||
|
||||
ASSERT_EQUALS("void func1 ( ) ;", tokenizeAndStringify("void func1() __asm__(\"...\");"));
|
||||
}
|
||||
|
||||
// #4725 - ^{}
|
||||
|
|
Loading…
Reference in New Issue