diff --git a/tests/syntax/cpp-command.c b/tests/syntax/cpp-command.c index b508b543b6b25745f437b481935ab3e1add8fa02..4a533887e76e6e5ee719c0efaec0174c0414c3bb 100644 --- a/tests/syntax/cpp-command.c +++ b/tests/syntax/cpp-command.c @@ -1,8 +1,18 @@ /* run.config* - FILTER: sed "s:/[^ ]*/cpp-command\.[^ ]*\.i:TMPDIR/FILE.i:g; s:$PWD/::; s: -m32::" + FILTER: sed "s:/[^ ]*[/]cpp-command\.[^ ]*\.i:TMPDIR/FILE.i:g; s:$PWD/::; s: -m32::" OPT: -machdep x86_32 -no-autoload-plugins -cpp-frama-c-compliant -cpp-command "echo [\$(basename '%1') \$(basename '%1') \$(basename '%i') \$(basename '%input')] ['%2' '%2' '%o' '%output'] ['%args']" OPT: -machdep x86_32 -no-autoload-plugins -cpp-frama-c-compliant -cpp-command "echo %%1 = \$(basename '%1') %%2 = '%2' %%args = '%args'" OPT: -machdep x86_32 -no-autoload-plugins -cpp-frama-c-compliant -cpp-command "printf \"%s\n\" \"using \\% has no effect : \$(basename \"\%input\")\"" OPT: -machdep x86_32 -no-autoload-plugins -cpp-frama-c-compliant -cpp-command "echo %var is not an interpreted placeholder" OPT: -machdep x86_32 -no-autoload-plugins -print-cpp-commands + OPT: -cpp-extra-args-per-file=@PTEST_FILE@:"-DPF=\\\"cp%02d_3f\\\"" -no-autoload-plugins @PTEST_FILE@ -print */ + +#include <stdio.h> +void printer(int i, float f) { + printf(PF, i, f); +} + +int main() { + printer(1, 1.0); +} diff --git a/tests/syntax/oracle/cpp-command.5.res.oracle b/tests/syntax/oracle/cpp-command.5.res.oracle new file mode 100644 index 0000000000000000000000000000000000000000..72e8b677b25bad905a4dda20d59cb6f552481de4 --- /dev/null +++ b/tests/syntax/oracle/cpp-command.5.res.oracle @@ -0,0 +1,21 @@ +[kernel] Parsing tests/syntax/cpp-command.c (with preprocessing) +/* Generated by Frama-C */ +#include "errno.h" +#include "stdarg.h" +#include "stddef.h" +#include "stdio.h" +void printer(int i, float f) +{ + printf("cp%02d_3f",i,(double)f); + return; +} + +int main(void) +{ + int __retres; + printer(1,(float)1.0); + __retres = 0; + return __retres; +} + +