diff options
| author | Nick Clifton <nickc@redhat.com> | 2011-04-13 07:50:15 +0000 |
|---|---|---|
| committer | Nick Clifton <nickc@redhat.com> | 2011-04-13 07:50:15 +0000 |
| commit | ec25acb399130caa864e238e64e36945684f9cc5 (patch) | |
| tree | a52ae137b98539376e41d6783b9ba09fabad67de /binutils/testsuite/binutils-all | |
| parent | dd948edaf7382827f65d52b4450371168e7e891d (diff) | |
| download | ppe42-binutils-ec25acb399130caa864e238e64e36945684f9cc5.tar.gz ppe42-binutils-ec25acb399130caa864e238e64e36945684f9cc5.zip | |
* windres.c (usage): Add new --preprocessor-arg option.
(option_values): Add new OPTION_PREPROCESSOR_ARG enumerator.
(option long_options): Add preprocessor-arg option.
(main): Handle it.
* doc/binutils.texi: Add documentation for --preprocessor-arg
option.
* NEWS: Add line about new --preprocessor-arg option for windres.
* binutils-all/windres/windres.exp: Add '// cpparg <option>' command
to rc file interpretation to specify addition pre-processor commands
as script option.
* binutils-all/windres/strtab3.rc: New.
* binutils-all/windres/strtab3.rsd: New.
* binutils-all/windres/README: Add note about cpparg script option.
argument
Diffstat (limited to 'binutils/testsuite/binutils-all')
4 files changed, 29 insertions, 1 deletions
diff --git a/binutils/testsuite/binutils-all/windres/README b/binutils/testsuite/binutils-all/windres/README index f990349499..66864881e4 100644 --- a/binutils/testsuite/binutils-all/windres/README +++ b/binutils/testsuite/binutils-all/windres/README @@ -12,6 +12,7 @@ contains one command: // parse-only // xfail *-*-* + // cpparg <preprocessor options passed via --preprocessor-arg> parse-only must preceed any xfail commands, and indicates that a comparison with the *.rsd file will not happen. xfail indicates when diff --git a/binutils/testsuite/binutils-all/windres/strtab3.rc b/binutils/testsuite/binutils-all/windres/strtab3.rc new file mode 100644 index 0000000000..542e9dc6c9 --- /dev/null +++ b/binutils/testsuite/binutils-all/windres/strtab3.rc @@ -0,0 +1,14 @@ +// cpparg -DTEST=1 + +#include "windows.h" + +LANGUAGE 0, 0 + +STRINGTABLE MOVEABLE PURE DISCARDABLE +BEGIN +#ifdef TEST + 1 "hello, world" +#else + 1 "fail" +#endif +END diff --git a/binutils/testsuite/binutils-all/windres/strtab3.rsd b/binutils/testsuite/binutils-all/windres/strtab3.rsd new file mode 100644 index 0000000000..4d61073935 --- /dev/null +++ b/binutils/testsuite/binutils-all/windres/strtab3.rsd @@ -0,0 +1,8 @@ + 0000 00000000 20000000 ffff0000 ffff0000 .... ........... + 0010 00000000 00000000 00000000 00000000 ................ + 0020 38000000 20000000 ffff0600 ffff0100 8... ........... + 0030 00000000 30100000 00000000 00000000 ....0........... + 0040 00000c00 68006500 6c006c00 6f002c00 ....h.e.l.l.o.,. + 0050 20007700 6f007200 6c006400 00000000 .w.o.r.l.d..... + 0060 00000000 00000000 00000000 00000000 ................ + 0070 00000000 00000000 ........ diff --git a/binutils/testsuite/binutils-all/windres/windres.exp b/binutils/testsuite/binutils-all/windres/windres.exp index 5b0c4afc89..2ef73ffeba 100644 --- a/binutils/testsuite/binutils-all/windres/windres.exp +++ b/binutils/testsuite/binutils-all/windres/windres.exp @@ -56,6 +56,7 @@ foreach res $res_list { set sroot [file rootname $res] set broot [file tail $sroot] set done 0 + set cpp_opts "" set rc [open $res] while { [gets $rc line] != -1 } { @@ -66,10 +67,14 @@ foreach res $res_list { setup_xfail $sys continue } + if [regexp "cpparg *(\[^ \]*)" $line junk cppopt] { + set cpp_opts "--preprocessor-arg \"$cppopt\"" + continue + } } verbose "$wr -J rc -O res $res tmpdir/$broot.res" 1 - catch "exec $wr -J rc -O res $res tmpdir/$broot.res" err + catch "exec $wr $cpp_opts -J rc -O res $res tmpdir/$broot.res" err if ![string match "" $err] then { send_log "$err\n" |

