diff options
author | Joseph Myers <joseph@codesourcery.com> | 2014-11-05 16:19:10 +0000 |
---|---|---|
committer | Joseph Myers <jsm28@gcc.gnu.org> | 2014-11-05 16:19:10 +0000 |
commit | 701cade1a260d5a78662e304a7cac0aaf2d77951 (patch) | |
tree | a5b5e4b6d1278ce3bdbc1a037dcffa589ea593a2 /gcc | |
parent | b92883d6ba13db87d893755f74532bfe5cb4ba72 (diff) | |
download | gcc-701cade1a260d5a78662e304a7cac0aaf2d77951.zip gcc-701cade1a260d5a78662e304a7cac0aaf2d77951.tar.gz gcc-701cade1a260d5a78662e304a7cac0aaf2d77951.tar.bz2 |
Enable -fextended-identifiers by default.
As proposed at <https://gcc.gnu.org/ml/gcc/2014-11/msg00014.html>,
this patch enables -fextended-identifiers by default for all standard
versions including this feature (all C++ versions, C99 and above for
C, but not C90 / C94 / gnu89 / preprocessing assembler). It adds a
couple of tests for areas where I previously noted testsuite coverage
for extended identifiers was lacking, removes -fextended-identifiers
from existing tests, adds -g to various such tests to verify that
extended identifiers don't break debug info generation and removes the
test that was only there to verify that the feature was off by
default.
The current state of the feature may not correspond exactly to any
particular checklist from 2004/5 (see bug 9449) of what was wanted
before enabling the feature by default, but I don't think it's any
worse than plenty of other features supported by default before every
corner case is fully functional, and think problems can readily be
fixed incrementally.
The following aspects of extended identifiers could still do with more
work (and should be straightforward):
* C -aux-info (output should use UCNs).
* ObjC -gen-decls (output should use UCNs; associated diagnostics from
the ObjC front end should use extended characters or UCNs as
appropriate to the locale, via using %qE or identifier_to_locale).
* Use DW_AT_use_UTF8 in DWARF-3 debug info for compilation units built
with extended identifiers enabled (or unconditionally).
* cpplib diagnostics (outputting characters or UCNs as appropriate
depending on the locale, as done for identifiers in non-cpplib
diagnostics).
* C++ test for UCN linking with C and extern "C".
* Check GDB support / file issues for support if needed.
* Actual UTF-8 in identifiers (?). (Be careful about not affecting
performance for the normal fast path of lexing identifiers, if
possible.)
The following may be trickier:
* cpplib spelling preservation (required to diagnose macro
redefinition with different spellings of the same identifier in the
definition or argument names; different spellings of the name of the
macro itself are OK, however; also required for correct handling of
multiple stringizing in C++); correct output for -d (UCNs), DWARF
debug info for macros (UCNs), PCH and PCH tests. (Spelling
preservation is the issue that needs fixing to remove references to
corner cases in the documentation of -std=c99 and -std=c11 and in
c99status.html.) The idea would be to add a second pointer to
cpp_identifier that stores the original spelling (whether for
extended identifiers only, or for all identifiers); this does not
enlarge cpp_token because the resulting larger cpp_identifier
structure is no bigger than cpp_string.
* C++ translation of extended characters (including $@` and various
control characters) to UCNs in phase 1 (note diagnostics thus
needed, but not for C++11, for control characters in strings /
character constants as those UCNs invalid); a likely implementation
approach is to do translation when identifiers / strings / character
constants are lexed, together with errors for stray $@` / control
characters in program as not being valid UCNs in identifiers ($ only
if not accepted in identifiers); note that this translation should
not take place inside raw string literals.
Bootstrapped with no regressions on x86_64-unknown-linux-gnu.
libcpp:
PR preprocessor/9449
* init.c (lang_defaults): Enable extended identifiers for C++ and
C99-based standards.
gcc:
PR preprocessor/9449
* doc/cpp.texi (Character sets, Tokenization)
(Implementation-defined behavior): Don't refer to UCNs in
identifiers requiring -fextended-identifiers.
* doc/cppopts.texi (-fextended-identifiers): Document as enabled
by default for C99 and later and C++.
* doc/invoke.texi (-std=c99, -std=c11): Don't refer to extended
identifiers needing -fextended-identifiers.
gcc/testsuite:
PR preprocessor/9449
* lib/target-supports.exp (check_effective_target_ucn_nocache):
Don't use -fextended-identifiers.
* c-c++-common/cpp/normalize-3.c, c-c++-common/cpp/ucnid-2011-1.c,
g++.dg/cpp/ucn-1.C, g++.dg/cpp/ucnid-1.C, g++.dg/other/ucnid-1.C,
gcc.dg/cpp/normalize-1.c, gcc.dg/cpp/normalize-2.c,
gcc.dg/cpp/normalize-4.c: Don't use -fextended-identifiers.
* gcc.dg/cpp/ucnid-1.c: Don't use -fextended-identifiers. Use
-g3.
* gcc.dg/cpp/ucnid-10.c, gcc.dg/cpp/ucnid-2.c,
gcc.dg/cpp/ucnid-3.c, gcc.dg/cpp/ucnid-4.c, gcc.dg/cpp/ucnid-5.c,
gcc.dg/cpp/ucnid-7.c, gcc.dg/cpp/ucnid-9.c,
gcc.dg/cpp/warn-normalized-1.c, gcc.dg/cpp/warn-normalized-2.c,
gcc.dg/cpp/warn-normalized-3.c: Don't use -fextended-identifiers.
* gcc.dg/ucnid-1.c, gcc.dg/ucnid-2.c, gcc.dg/ucnid-3.c,
gcc.dg/ucnid-4.c, gcc.dg/ucnid-5.c, gcc.dg/ucnid-6.c: Don't use
-fextended-identifiers. Use -g.
* gcc.dg/ucnid-7.c, gcc.dg/ucnid-8.c: Don't use
-fextended-identifiers.
* gcc.dg/ucnid-9.c: Don't use -fextended-identifiers. Use -g.
* gcc.dg/ucnid-10.c: Don't use -fextended-identifiers.
* gcc.dg/ucnid-11.c, gcc.dg/ucnid-12.c: Don't use
-fextended-identifiers. Use -g.
* gcc.dg/ucnid-13.c: Don't use -fextended-identifiers.
* gcc.dg/cpp/ucnid-8.c: Remove test.
* gcc.dg/cpp/ucnid-10.c, gcc.dg/ucnid-14.c: New tests.
From-SVN: r217144
Diffstat (limited to 'gcc')
40 files changed, 118 insertions, 61 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2fe8c8a..c5b14a0 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,14 @@ +2014-11-05 Joseph Myers <joseph@codesourcery.com> + + PR preprocessor/9449 + * doc/cpp.texi (Character sets, Tokenization) + (Implementation-defined behavior): Don't refer to UCNs in + identifiers requiring -fextended-identifiers. + * doc/cppopts.texi (-fextended-identifiers): Document as enabled + by default for C99 and later and C++. + * doc/invoke.texi (-std=c99, -std=c11): Don't refer to extended + identifiers needing -fextended-identifiers. + 2014-11-05 Ilya Tocar <ilya.tocar@intel.com> * config/i386/i386.c (expand_vec_perm_pshufb): Try vpermq/vpermd diff --git a/gcc/doc/cpp.texi b/gcc/doc/cpp.texi index 0a6e50c..f32aac7 100644 --- a/gcc/doc/cpp.texi +++ b/gcc/doc/cpp.texi @@ -275,11 +275,11 @@ the character in the source character set that they represent, then converted to the execution character set, just like unescaped characters. -Unless the experimental @option{-fextended-identifiers} option is used, -GCC does not permit the use of characters outside the ASCII range, nor -@samp{\u} and @samp{\U} escapes, in identifiers. Even with that -option, characters outside the ASCII range can only be specified with -the @samp{\u} and @samp{\U} escapes, not used directly in identifiers. +In identifiers, characters outside the ASCII range can only be +specified with the @samp{\u} and @samp{\U} escapes, not used +directly. If strict ISO C90 conformance is specified with an option +such as @option{-std=c90}, or @option{-fno-extended-identifiers} is +used, then those escapes are not permitted in identifiers. @node Initial processing @section Initial processing @@ -504,10 +504,8 @@ In the 1999 C standard, identifiers may contain letters which are not part of the ``basic source character set'', at the implementation's discretion (such as accented Latin letters, Greek letters, or Chinese ideograms). This may be done with an extended character set, or the -@samp{\u} and @samp{\U} escape sequences. The implementation of this -feature in GCC is experimental; such characters are only accepted in -the @samp{\u} and @samp{\U} forms and only if -@option{-fextended-identifiers} is used. +@samp{\u} and @samp{\U} escape sequences. GCC only accepts such +characters in the @samp{\u} and @samp{\U} forms. As an extension, GCC treats @samp{$} as a letter. This is for compatibility with some systems, such as VMS, where @samp{$} is commonly @@ -4100,9 +4098,7 @@ be controlled using the @option{-fexec-charset} and The C and C++ standards allow identifiers to be composed of @samp{_} and the alphanumeric characters. C++ and C99 also allow universal character names, and C99 further permits implementation-defined -characters. GCC currently only permits universal character names if -@option{-fextended-identifiers} is used, because the implementation of -universal character names in identifiers is experimental. +characters. GCC allows the @samp{$} character in identifiers as an extension for most targets. This is true regardless of the @option{std=} switch, diff --git a/gcc/doc/cppopts.texi b/gcc/doc/cppopts.texi index c5c8a70..150e74f 100644 --- a/gcc/doc/cppopts.texi +++ b/gcc/doc/cppopts.texi @@ -560,8 +560,7 @@ Accept @samp{$} in identifiers. @item -fextended-identifiers @opindex fextended-identifiers Accept universal character names in identifiers. This option is -experimental; in a future version of GCC, it will be enabled by -default for C99 and C++. +enabled by default for C99 (and later C standard versions) and C++. @item -fno-canonical-system-headers @opindex fno-canonical-system-headers diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index b7c8001..a642933 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -1674,8 +1674,7 @@ ISO C90 as modified in amendment 1. @itemx iso9899:1999 @itemx iso9899:199x ISO C99. This standard is substantially completely supported, modulo -bugs, extended identifiers (supported except for corner cases when -@option{-fextended-identifiers} is used) and floating-point issues +bugs, corner cases of extended identifiers and floating-point issues (mainly but not entirely relating to optional C99 features from Annexes F and G). See @w{@uref{http://gcc.gnu.org/c99status.html}} for more information. The @@ -1685,9 +1684,8 @@ names @samp{c9x} and @samp{iso9899:199x} are deprecated. @itemx c1x @itemx iso9899:2011 ISO C11, the 2011 revision of the ISO C standard. This standard is -substantially completely supported, modulo bugs, extended identifiers -(supported except for corner cases when -@option{-fextended-identifiers} is used), floating-point issues +substantially completely supported, modulo bugs, corner cases of +extended identifiers, floating-point issues (mainly but not entirely relating to optional C11 features from Annexes F and G) and the optional Annexes K (Bounds-checking interfaces) and L (Analyzability). The name @samp{c1x} is deprecated. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 9dea355..924ed28 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,32 @@ +2014-11-05 Joseph Myers <joseph@codesourcery.com> + + PR preprocessor/9449 + * lib/target-supports.exp (check_effective_target_ucn_nocache): + Don't use -fextended-identifiers. + * c-c++-common/cpp/normalize-3.c, c-c++-common/cpp/ucnid-2011-1.c, + g++.dg/cpp/ucn-1.C, g++.dg/cpp/ucnid-1.C, g++.dg/other/ucnid-1.C, + gcc.dg/cpp/normalize-1.c, gcc.dg/cpp/normalize-2.c, + gcc.dg/cpp/normalize-4.c: Don't use -fextended-identifiers. + * gcc.dg/cpp/ucnid-1.c: Don't use -fextended-identifiers. Use + -g3. + * gcc.dg/cpp/ucnid-10.c, gcc.dg/cpp/ucnid-2.c, + gcc.dg/cpp/ucnid-3.c, gcc.dg/cpp/ucnid-4.c, gcc.dg/cpp/ucnid-5.c, + gcc.dg/cpp/ucnid-7.c, gcc.dg/cpp/ucnid-9.c, + gcc.dg/cpp/warn-normalized-1.c, gcc.dg/cpp/warn-normalized-2.c, + gcc.dg/cpp/warn-normalized-3.c: Don't use -fextended-identifiers. + * gcc.dg/ucnid-1.c, gcc.dg/ucnid-2.c, gcc.dg/ucnid-3.c, + gcc.dg/ucnid-4.c, gcc.dg/ucnid-5.c, gcc.dg/ucnid-6.c: Don't use + -fextended-identifiers. Use -g. + * gcc.dg/ucnid-7.c, gcc.dg/ucnid-8.c: Don't use + -fextended-identifiers. + * gcc.dg/ucnid-9.c: Don't use -fextended-identifiers. Use -g. + * gcc.dg/ucnid-10.c: Don't use -fextended-identifiers. + * gcc.dg/ucnid-11.c, gcc.dg/ucnid-12.c: Don't use + -fextended-identifiers. Use -g. + * gcc.dg/ucnid-13.c: Don't use -fextended-identifiers. + * gcc.dg/cpp/ucnid-8.c: Remove test. + * gcc.dg/cpp/ucnid-10.c, gcc.dg/ucnid-14.c: New tests. + 2014-11-05 Christophe Lyon <christophe.lyon@linaro.org> * gcc.target/aarch64/advsimd-intrinsics/advsimd-intrinsics.exp: diff --git a/gcc/testsuite/c-c++-common/cpp/normalize-3.c b/gcc/testsuite/c-c++-common/cpp/normalize-3.c index ae0184c..faafdbf 100644 --- a/gcc/testsuite/c-c++-common/cpp/normalize-3.c +++ b/gcc/testsuite/c-c++-common/cpp/normalize-3.c @@ -1,6 +1,6 @@ /* { dg-do preprocess } */ -/* { dg-options "-std=c99 -fextended-identifiers -Wnormalized=id" { target c } } */ -/* { dg-options "-fextended-identifiers -Wnormalized=id" { target c++ } } */ +/* { dg-options "-std=c99 -Wnormalized=id" { target c } } */ +/* { dg-options "-Wnormalized=id" { target c++ } } */ \u00AA \u00B7 diff --git a/gcc/testsuite/c-c++-common/cpp/ucnid-2011-1.c b/gcc/testsuite/c-c++-common/cpp/ucnid-2011-1.c index e3c6d26..b7ebce8 100644 --- a/gcc/testsuite/c-c++-common/cpp/ucnid-2011-1.c +++ b/gcc/testsuite/c-c++-common/cpp/ucnid-2011-1.c @@ -1,6 +1,6 @@ /* { dg-do preprocess } */ -/* { dg-options "-std=c11 -pedantic -fextended-identifiers" { target c } } */ -/* { dg-options "-std=c++11 -pedantic -fextended-identifiers" { target c++ } } */ +/* { dg-options "-std=c11 -pedantic" { target c } } */ +/* { dg-options "-std=c++11 -pedantic" { target c++ } } */ \u00A8 diff --git a/gcc/testsuite/g++.dg/cpp/ucn-1.C b/gcc/testsuite/g++.dg/cpp/ucn-1.C index b2d4f98..880e899 100644 --- a/gcc/testsuite/g++.dg/cpp/ucn-1.C +++ b/gcc/testsuite/g++.dg/cpp/ucn-1.C @@ -1,6 +1,6 @@ // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2170.html // { dg-do compile { target c++11 } } -// { dg-options "-fextended-identifiers" } +// { dg-options "" } int main() { diff --git a/gcc/testsuite/g++.dg/cpp/ucnid-1.C b/gcc/testsuite/g++.dg/cpp/ucnid-1.C index 7a8f72a..65c8995 100644 --- a/gcc/testsuite/g++.dg/cpp/ucnid-1.C +++ b/gcc/testsuite/g++.dg/cpp/ucnid-1.C @@ -1,5 +1,5 @@ /* { dg-do preprocess } */ -/* { dg-options "-std=gnu++98 -pedantic -fextended-identifiers" } */ +/* { dg-options "-std=gnu++98 -pedantic" } */ \u00AA /* { dg-error "not valid in an identifier" } */ \u00AB /* { dg-error "not valid in an identifier" } */ diff --git a/gcc/testsuite/g++.dg/other/ucnid-1.C b/gcc/testsuite/g++.dg/other/ucnid-1.C index 9a2728f..95a31cb 100644 --- a/gcc/testsuite/g++.dg/other/ucnid-1.C +++ b/gcc/testsuite/g++.dg/other/ucnid-1.C @@ -1,5 +1,5 @@ /* { dg-do run } */ -/* { dg-options "-fextended-identifiers" } */ +/* { dg-options "" } */ /* { dg-xfail-if "" { powerpc-ibm-aix* } { "*" } { "" } } */ /* { dg-skip-if "" { ! ucn } { "*" } { "" } } */ #include <cstdlib> diff --git a/gcc/testsuite/gcc.dg/cpp/normalize-1.c b/gcc/testsuite/gcc.dg/cpp/normalize-1.c index b20f235..768e193 100644 --- a/gcc/testsuite/gcc.dg/cpp/normalize-1.c +++ b/gcc/testsuite/gcc.dg/cpp/normalize-1.c @@ -1,5 +1,5 @@ /* { dg-do preprocess } */ -/* { dg-options "-std=c99 -fextended-identifiers" } */ +/* { dg-options "-std=c99" } */ \u00AA \u00B7 diff --git a/gcc/testsuite/gcc.dg/cpp/normalize-2.c b/gcc/testsuite/gcc.dg/cpp/normalize-2.c index 6f2f495..28ef2f1 100644 --- a/gcc/testsuite/gcc.dg/cpp/normalize-2.c +++ b/gcc/testsuite/gcc.dg/cpp/normalize-2.c @@ -1,5 +1,5 @@ /* { dg-do preprocess } */ -/* { dg-options "-std=c99 -fextended-identifiers -Wnormalized=nfkc" } */ +/* { dg-options "-std=c99 -Wnormalized=nfkc" } */ \u00AA /* { dg-warning "not in NFKC" } */ \u00B7 diff --git a/gcc/testsuite/gcc.dg/cpp/normalize-4.c b/gcc/testsuite/gcc.dg/cpp/normalize-4.c index 0040c03..1ee3ff5 100644 --- a/gcc/testsuite/gcc.dg/cpp/normalize-4.c +++ b/gcc/testsuite/gcc.dg/cpp/normalize-4.c @@ -1,5 +1,5 @@ /* { dg-do preprocess } */ -/* { dg-options "-std=c99 -fextended-identifiers -Wnormalized=none" } */ +/* { dg-options "-std=c99 -Wnormalized=none" } */ \u00AA \u00B7 diff --git a/gcc/testsuite/gcc.dg/cpp/ucnid-1.c b/gcc/testsuite/gcc.dg/cpp/ucnid-1.c index 3fad088..c77111d 100644 --- a/gcc/testsuite/gcc.dg/cpp/ucnid-1.c +++ b/gcc/testsuite/gcc.dg/cpp/ucnid-1.c @@ -1,5 +1,5 @@ /* { dg-do run } */ -/* { dg-options "-std=c99 -fextended-identifiers" } */ +/* { dg-options "-std=c99 -g3" } */ void abort (void); #define \u00C0 1 diff --git a/gcc/testsuite/gcc.dg/cpp/ucnid-10.c b/gcc/testsuite/gcc.dg/cpp/ucnid-10.c new file mode 100644 index 0000000..0ac035b --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/ucnid-10.c @@ -0,0 +1,8 @@ +/* Test UCNs are allowed in preprocessing numbers. */ +/* { dg-do compile } */ +/* { dg-options "-std=c99" } */ + +#define a(x) b(x) +#define b(x) 0 +#define p ) +int c = a(0\u00c0.p); diff --git a/gcc/testsuite/gcc.dg/cpp/ucnid-2.c b/gcc/testsuite/gcc.dg/cpp/ucnid-2.c index 6719c78..616680a 100644 --- a/gcc/testsuite/gcc.dg/cpp/ucnid-2.c +++ b/gcc/testsuite/gcc.dg/cpp/ucnid-2.c @@ -1,5 +1,5 @@ /* { dg-do run } */ -/* { dg-options "-std=c99 -fextended-identifiers" } */ +/* { dg-options "-std=c99" } */ #include <stdlib.h> #include <string.h> diff --git a/gcc/testsuite/gcc.dg/cpp/ucnid-3.c b/gcc/testsuite/gcc.dg/cpp/ucnid-3.c index 6389b7e..a910037 100644 --- a/gcc/testsuite/gcc.dg/cpp/ucnid-3.c +++ b/gcc/testsuite/gcc.dg/cpp/ucnid-3.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-std=c99 -fextended-identifiers" } */ +/* { dg-options "-std=c99" } */ #define paste(x, y) x ## y diff --git a/gcc/testsuite/gcc.dg/cpp/ucnid-4.c b/gcc/testsuite/gcc.dg/cpp/ucnid-4.c index 6a6699b..e41a3f5 100644 --- a/gcc/testsuite/gcc.dg/cpp/ucnid-4.c +++ b/gcc/testsuite/gcc.dg/cpp/ucnid-4.c @@ -1,5 +1,5 @@ /* { dg-do preprocess } */ -/* { dg-options "-std=c99 -fextended-identifiers" } */ +/* { dg-options "-std=c99" } */ \u00AA \u00AB /* { dg-error "not valid in an identifier" } */ diff --git a/gcc/testsuite/gcc.dg/cpp/ucnid-5.c b/gcc/testsuite/gcc.dg/cpp/ucnid-5.c index cdccd3c..8fcaeac 100644 --- a/gcc/testsuite/gcc.dg/cpp/ucnid-5.c +++ b/gcc/testsuite/gcc.dg/cpp/ucnid-5.c @@ -1,5 +1,5 @@ /* { dg-do preprocess } */ -/* { dg-options "-std=c99 -pedantic -fextended-identifiers" } */ +/* { dg-options "-std=c99 -pedantic" } */ \u00AA \u00AB /* { dg-error "not valid in an identifier" } */ diff --git a/gcc/testsuite/gcc.dg/cpp/ucnid-7.c b/gcc/testsuite/gcc.dg/cpp/ucnid-7.c index 9340422..854c948 100644 --- a/gcc/testsuite/gcc.dg/cpp/ucnid-7.c +++ b/gcc/testsuite/gcc.dg/cpp/ucnid-7.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-std=c99 -fextended-identifiers" } */ +/* { dg-options "-std=c99" } */ #define a b( #define b(x) q int a\U0000000z ); diff --git a/gcc/testsuite/gcc.dg/cpp/ucnid-8.c b/gcc/testsuite/gcc.dg/cpp/ucnid-8.c deleted file mode 100644 index 1f0379a..0000000 --- a/gcc/testsuite/gcc.dg/cpp/ucnid-8.c +++ /dev/null @@ -1,8 +0,0 @@ -/* { dg-do compile } */ -/* { dg-options "-std=c99" } */ -/* Test that -std=c99 does not enable extended identifiers while the - feature is experimental; remove this test after audit of all - identifier uses in the compiler. */ -#define a b( -#define b(x) q -int a\u00aa); diff --git a/gcc/testsuite/gcc.dg/cpp/ucnid-9.c b/gcc/testsuite/gcc.dg/cpp/ucnid-9.c index 8dc4345..8562f9b 100644 --- a/gcc/testsuite/gcc.dg/cpp/ucnid-9.c +++ b/gcc/testsuite/gcc.dg/cpp/ucnid-9.c @@ -1,5 +1,5 @@ /* { dg-do preprocess } */ -/* { dg-options "-std=c99 -pedantic -fextended-identifiers" } */ +/* { dg-options "-std=c99 -pedantic" } */ \u2160 \u2182 diff --git a/gcc/testsuite/gcc.dg/cpp/warn-normalized-1.c b/gcc/testsuite/gcc.dg/cpp/warn-normalized-1.c index fe1c575..c047f5f 100644 --- a/gcc/testsuite/gcc.dg/cpp/warn-normalized-1.c +++ b/gcc/testsuite/gcc.dg/cpp/warn-normalized-1.c @@ -1,4 +1,4 @@ // { dg-do preprocess } -// { dg-options "-std=gnu99 -fdiagnostics-show-option -fextended-identifiers -Wnormalized=nfc" } +// { dg-options "-std=gnu99 -fdiagnostics-show-option -Wnormalized=nfc" } \u0F43 // { dg-warning "`.U00000f43' is not in NFC .-Wnormalized=." } diff --git a/gcc/testsuite/gcc.dg/cpp/warn-normalized-2.c b/gcc/testsuite/gcc.dg/cpp/warn-normalized-2.c index f1fb968..5c8c7c5 100644 --- a/gcc/testsuite/gcc.dg/cpp/warn-normalized-2.c +++ b/gcc/testsuite/gcc.dg/cpp/warn-normalized-2.c @@ -1,4 +1,4 @@ // { dg-do preprocess } -// { dg-options "-std=gnu99 -fdiagnostics-show-option -fextended-identifiers -Wnormalized=nfkc" } +// { dg-options "-std=gnu99 -fdiagnostics-show-option -Wnormalized=nfkc" } \u00AA // { dg-warning "`.U000000aa' is not in NFKC .-Wnormalized=." } diff --git a/gcc/testsuite/gcc.dg/cpp/warn-normalized-3.c b/gcc/testsuite/gcc.dg/cpp/warn-normalized-3.c index d6cd56f..2251e28 100644 --- a/gcc/testsuite/gcc.dg/cpp/warn-normalized-3.c +++ b/gcc/testsuite/gcc.dg/cpp/warn-normalized-3.c @@ -1,4 +1,4 @@ // { dg-do preprocess } -// { dg-options "-std=gnu99 -fdiagnostics-show-option -fextended-identifiers -Werror=normalized=" } +// { dg-options "-std=gnu99 -fdiagnostics-show-option -Werror=normalized=" } /* { dg-message "some warnings being treated as errors" "" {target "*-*-*"} 0 } */ \u0F43 // { dg-error "`.U00000f43' is not in NFC .-Werror=normalized=." } diff --git a/gcc/testsuite/gcc.dg/ucnid-1.c b/gcc/testsuite/gcc.dg/ucnid-1.c index ed89cfd..067a692 100644 --- a/gcc/testsuite/gcc.dg/ucnid-1.c +++ b/gcc/testsuite/gcc.dg/ucnid-1.c @@ -1,5 +1,5 @@ /* { dg-do run } */ -/* { dg-options "-std=c99 -fextended-identifiers" } */ +/* { dg-options "-std=c99 -g" } */ void abort (void); int main (void) diff --git a/gcc/testsuite/gcc.dg/ucnid-10.c b/gcc/testsuite/gcc.dg/ucnid-10.c index 83425d3..1438337 100644 --- a/gcc/testsuite/gcc.dg/ucnid-10.c +++ b/gcc/testsuite/gcc.dg/ucnid-10.c @@ -1,7 +1,7 @@ /* Verify diagnostics for extended identifiers refer to UCNs (in the C locale). Test #pragma pack diagnostics. */ /* { dg-do compile } */ -/* { dg-options "-std=gnu99 -fextended-identifiers" } */ +/* { dg-options "-std=gnu99" } */ /* { dg-require-ascii-locale "" } */ /* { dg-skip-if "" { powerpc-ibm-aix* } { "*" } { "" } } */ diff --git a/gcc/testsuite/gcc.dg/ucnid-11.c b/gcc/testsuite/gcc.dg/ucnid-11.c index 6d40ef4..0ef6bfe 100644 --- a/gcc/testsuite/gcc.dg/ucnid-11.c +++ b/gcc/testsuite/gcc.dg/ucnid-11.c @@ -2,6 +2,6 @@ /* { dg-xfail-if "" { powerpc-ibm-aix* } { "*" } { "" } } */ /* { dg-skip-if "" { ! ucn } { "*" } { "" } } */ /* { dg-skip-if "-fdata-sections not supported" { { hppa*-*-hpux* } && { ! lp64 } } { "*" } { "" } } */ -/* { dg-options "-std=c99 -fextended-identifiers -fdata-sections" } */ +/* { dg-options "-std=c99 -fdata-sections -g" } */ #include "ucnid-3.c" diff --git a/gcc/testsuite/gcc.dg/ucnid-12.c b/gcc/testsuite/gcc.dg/ucnid-12.c index dd5e6d5..ca50653 100644 --- a/gcc/testsuite/gcc.dg/ucnid-12.c +++ b/gcc/testsuite/gcc.dg/ucnid-12.c @@ -2,6 +2,6 @@ /* { dg-xfail-if "" { powerpc-ibm-aix* } { "*" } { "" } } */ /* { dg-skip-if "" { ! ucn } { "*" } { "" } } */ /* { dg-skip-if "-ffunction-sections not supported" { { hppa*-*-hpux* } && { ! lp64 } } { "*" } { "" } } */ -/* { dg-options "-std=c99 -fextended-identifiers -ffunction-sections" } */ +/* { dg-options "-std=c99 -ffunction-sections -g" } */ #include "ucnid-4.c" diff --git a/gcc/testsuite/gcc.dg/ucnid-13.c b/gcc/testsuite/gcc.dg/ucnid-13.c index 0b94247..871f103 100644 --- a/gcc/testsuite/gcc.dg/ucnid-13.c +++ b/gcc/testsuite/gcc.dg/ucnid-13.c @@ -1,7 +1,7 @@ /* Verify diagnostics for extended identifiers refer to UCNs (in the C locale). Miscellaneous diagnostics. */ /* { dg-do compile } */ -/* { dg-options "-std=gnu99 -fextended-identifiers -Wpacked" } */ +/* { dg-options "-std=gnu99 -Wpacked" } */ /* { dg-require-ascii-locale "" } */ /* { dg-skip-if "" { powerpc-ibm-aix* } { "*" } { "" } } */ diff --git a/gcc/testsuite/gcc.dg/ucnid-14.c b/gcc/testsuite/gcc.dg/ucnid-14.c new file mode 100644 index 0000000..8d4eb71 --- /dev/null +++ b/gcc/testsuite/gcc.dg/ucnid-14.c @@ -0,0 +1,23 @@ +/* Test miscellaneous uses of UCNs in identifiers compile and run OK, + with debug info enabled. */ +/* { dg-do run } */ +/* { dg-options "-std=c99 -g" } */ + +extern void abort (void); +extern void exit (int); + +int +main (void) +{ + struct \u00C0 { int \u00C1; } x; + struct \u00C0 *y = &x; + y->\u00C1 = 1; + if (x.\U000000C1 != 1) + abort (); + goto \u00ff; + \u00ff: ; + enum e { \u00C2 = 4 }; + if (\u00C2 != 4) + abort (); + exit (0); +} diff --git a/gcc/testsuite/gcc.dg/ucnid-2.c b/gcc/testsuite/gcc.dg/ucnid-2.c index 9cbc750..577df38 100644 --- a/gcc/testsuite/gcc.dg/ucnid-2.c +++ b/gcc/testsuite/gcc.dg/ucnid-2.c @@ -1,7 +1,7 @@ /* { dg-do run } */ /* { dg-xfail-if "" { powerpc-ibm-aix* } { "*" } { "" } } */ /* { dg-skip-if "" { ! ucn } { "*" } { "" } } */ -/* { dg-options "-std=c99 -fextended-identifiers" } */ +/* { dg-options "-std=c99 -g" } */ void abort (void); static int \u00C0 = 1; diff --git a/gcc/testsuite/gcc.dg/ucnid-3.c b/gcc/testsuite/gcc.dg/ucnid-3.c index 5ea0d03..0f8d46b 100644 --- a/gcc/testsuite/gcc.dg/ucnid-3.c +++ b/gcc/testsuite/gcc.dg/ucnid-3.c @@ -1,7 +1,7 @@ /* { dg-do run } */ /* { dg-xfail-if "" { powerpc-ibm-aix* } { "*" } { "" } } */ /* { dg-skip-if "" { ! ucn } { "*" } { "" } } */ -/* { dg-options "-std=c99 -fextended-identifiers" } */ +/* { dg-options "-std=c99 -g" } */ void abort (void); int \u00C0 = 1; diff --git a/gcc/testsuite/gcc.dg/ucnid-4.c b/gcc/testsuite/gcc.dg/ucnid-4.c index a18e6e3..443dcb9 100644 --- a/gcc/testsuite/gcc.dg/ucnid-4.c +++ b/gcc/testsuite/gcc.dg/ucnid-4.c @@ -1,7 +1,7 @@ /* { dg-do run } */ /* { dg-xfail-if "" { powerpc-ibm-aix* } { "*" } { "" } } */ /* { dg-skip-if "" { ! ucn } { "*" } { "" } } */ -/* { dg-options "-std=c99 -fextended-identifiers" } */ +/* { dg-options "-std=c99 -g" } */ void abort (void); int \u00C0(void) { return 1; } diff --git a/gcc/testsuite/gcc.dg/ucnid-5.c b/gcc/testsuite/gcc.dg/ucnid-5.c index c7ad8ff..a83dc8d 100644 --- a/gcc/testsuite/gcc.dg/ucnid-5.c +++ b/gcc/testsuite/gcc.dg/ucnid-5.c @@ -1,6 +1,6 @@ /* { dg-do run } */ /* { dg-skip-if "No dollar in identfiers" { "avr-*-*" } { "*" } { "" } } */ -/* { dg-options "-std=c99 -fdollars-in-identifiers -fextended-identifiers" } */ +/* { dg-options "-std=c99 -fdollars-in-identifiers -g" } */ void abort (void); int a$b(void) { return 1; } diff --git a/gcc/testsuite/gcc.dg/ucnid-6.c b/gcc/testsuite/gcc.dg/ucnid-6.c index 5713a84..70dd7b6 100644 --- a/gcc/testsuite/gcc.dg/ucnid-6.c +++ b/gcc/testsuite/gcc.dg/ucnid-6.c @@ -1,7 +1,7 @@ /* { dg-do run } */ /* { dg-xfail-if "" { "powerpc-ibm-aix*" } { "*" } { "" } } */ /* { dg-skip-if "" { ! ucn } { "*" } { "" } } */ -/* { dg-options "-std=c99 -fextended-identifiers -save-temps" } */ +/* { dg-options "-std=c99 -save-temps -g" } */ void abort (void); int \u00C0(void) { return 1; } diff --git a/gcc/testsuite/gcc.dg/ucnid-7.c b/gcc/testsuite/gcc.dg/ucnid-7.c index 3f73e35..b90bf68 100644 --- a/gcc/testsuite/gcc.dg/ucnid-7.c +++ b/gcc/testsuite/gcc.dg/ucnid-7.c @@ -1,7 +1,7 @@ /* Verify diagnostics for extended identifiers refer to UCNs (in the C locale). */ /* { dg-do compile } */ -/* { dg-options "-std=c99 -fextended-identifiers" } */ +/* { dg-options "-std=c99" } */ /* { dg-require-ascii-locale "" } */ /* { dg-skip-if "" { "powerpc-ibm-aix*" } { "*" } { "" } } */ diff --git a/gcc/testsuite/gcc.dg/ucnid-8.c b/gcc/testsuite/gcc.dg/ucnid-8.c index da72e2d..703b776 100644 --- a/gcc/testsuite/gcc.dg/ucnid-8.c +++ b/gcc/testsuite/gcc.dg/ucnid-8.c @@ -1,7 +1,7 @@ /* Verify diagnostics for extended identifiers refer to UCNs (in the C locale). Further tests of C front-end diagnostics. */ /* { dg-do compile } */ -/* { dg-options "-std=gnu99 -fextended-identifiers -Wvla" } */ +/* { dg-options "-std=gnu99 -Wvla" } */ /* { dg-require-ascii-locale "" } */ /* { dg-skip-if "" { powerpc-ibm-aix* } { "*" } { "" } } */ diff --git a/gcc/testsuite/gcc.dg/ucnid-9.c b/gcc/testsuite/gcc.dg/ucnid-9.c index a6f9118..6af6d76 100644 --- a/gcc/testsuite/gcc.dg/ucnid-9.c +++ b/gcc/testsuite/gcc.dg/ucnid-9.c @@ -3,7 +3,7 @@ /* { dg-do run } */ /* { dg-xfail-if "" { "powerpc-ibm-aix*" } { "*" } { "" } } */ /* { dg-skip-if "" { ! ucn } { "*" } { "" } } */ -/* { dg-options "-std=c99 -fextended-identifiers -fexec-charset=ISO-8859-1" } */ +/* { dg-options "-std=c99 -fexec-charset=ISO-8859-1 -g" } */ /* { dg-require-iconv "ISO-8859-1" } */ extern int strcmp (const char *, const char *); diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 5a38641..5e5338d 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -2020,8 +2020,9 @@ proc check_effective_target_ucn_nocache { } { # -std=c99 is only valid for C if [check_effective_target_c] { set ucnopts "-std=c99" + } else { + set ucnopts "" } - append ucnopts " -fextended-identifiers" verbose "check_effective_target_ucn_nocache: compiling source" 2 set ret [check_no_compiler_messages_nocache ucn object { int \u00C0; |