mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-01-11 23:35:35 +08:00
re PR driver/48524 (spec language does not cover switches with separated form)
2012-02-08 Magnus Granberg <zorry@gentoo.org> PR driver/48524 * gcc.c (switch_matches) Support switches with separated form, -D and -U. testsuite: * gcc.dg/pr48524.c: New test. * gcc.dg/pr48524.spec: New spec file for test. From-SVN: r184022
This commit is contained in:
parent
893f430128
commit
5371f7195e
@ -1,3 +1,9 @@
|
||||
2012-02-08 Magnus Granberg <zorry@gentoo.org>
|
||||
|
||||
PR driver/48524
|
||||
* gcc.c (switch_matches) Support switches with separated form, -D
|
||||
and -U.
|
||||
|
||||
2012-02-08 Georg-Johann Lay <avr@gjlay.de>
|
||||
|
||||
* config/avr/avr.md (SREG_ADDR): Remove constant definition.
|
||||
|
15
gcc/gcc.c
15
gcc/gcc.c
@ -5455,6 +5455,21 @@ switch_matches (const char *atom, const char *end_atom, int starred)
|
||||
&& check_live_switch (i, plen))
|
||||
return true;
|
||||
|
||||
/* Check if a switch with separated form matching the atom.
|
||||
We check -D and -U switches. */
|
||||
else if (switches[i].args != 0)
|
||||
{
|
||||
if ((*switches[i].part1 == 'D' || *switches[i].part1 == 'U')
|
||||
&& *switches[i].part1 == atom[0])
|
||||
{
|
||||
if (!strncmp (switches[i].args[0], &atom[1], len - 1)
|
||||
&& (starred || (switches[i].part1[1] == '\0'
|
||||
&& switches[i].args[0][len - 1] == '\0'))
|
||||
&& check_live_switch (i, (starred ? 1 : -1)))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -1,3 +1,9 @@
|
||||
2012-02-08 Magnus Granberg <zorry@gentoo.org>
|
||||
|
||||
PR driver/48524
|
||||
* gcc.dg/pr48524.c: New test.
|
||||
* gcc.dg/pr48524.spec: New spec file for test.
|
||||
|
||||
2012-02-08 Thomas Koenig <tkoenig@gcc.gnu.org>
|
||||
|
||||
PR fortran/32380
|
||||
|
6
gcc/testsuite/gcc.dg/pr48524.c
Normal file
6
gcc/testsuite/gcc.dg/pr48524.c
Normal file
@ -0,0 +1,6 @@
|
||||
/* { dg-do preprocess } */
|
||||
/* { dg-options "-specs=${srcdir}/gcc.dg/pr48524.spec -D_TEST_D" } */
|
||||
# ifdef _FOO
|
||||
# error works /* { dg-error "works" } */
|
||||
# endif
|
||||
|
5
gcc/testsuite/gcc.dg/pr48524.spec
Normal file
5
gcc/testsuite/gcc.dg/pr48524.spec
Normal file
@ -0,0 +1,5 @@
|
||||
*cpp_options:
|
||||
%(cpp_unique_options) %1 %{m*} %{std*&ansi&trigraphs} %{W*&pedantic*} %{w}\
|
||||
%{f*} %{g*:%{!g0:%{g*} %{!fno-working-directory:-fworking-directory}}} %{O*}\
|
||||
%{undef} %{save-temps*:-fpch-preprocess} %{D_TEST_D:-D_FOO}
|
||||
|
Loading…
Reference in New Issue
Block a user