OpenCores
URL https://opencores.org/ocsvn/open8_urisc/open8_urisc/trunk

Subversion Repositories open8_urisc

[/] [open8_urisc/] [trunk/] [gnu/] [binutils/] [libiberty/] [testsuite/] [test-demangle.c] - Diff between revs 21 and 161

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 21 Rev 161
Line 157... Line 157...
                         is with DMGL_PARAMS, the second is without it.
                         is with DMGL_PARAMS, the second is without it.
     --is-v3-ctor        Calls is_gnu_v3_mangled_ctor on input; expected
     --is-v3-ctor        Calls is_gnu_v3_mangled_ctor on input; expected
                         output is an integer representing ctor_kind.
                         output is an integer representing ctor_kind.
     --is-v3-dtor        Likewise, but for dtors.
     --is-v3-dtor        Likewise, but for dtors.
     --ret-postfix       Passes the DMGL_RET_POSTFIX option
     --ret-postfix       Passes the DMGL_RET_POSTFIX option
 
     --ret-drop          Passes the DMGL_RET_DROP option
 
 
   For compatibility, just in case it matters, the options line may be
   For compatibility, just in case it matters, the options line may be
   empty, to mean --format=auto.  If it doesn't start with --, then it
   empty, to mean --format=auto.  If it doesn't start with --, then it
   may contain only a format name.
   may contain only a format name.
*/
*/
Line 172... Line 173...
{
{
  enum demangling_styles style = auto_demangling;
  enum demangling_styles style = auto_demangling;
  int no_params;
  int no_params;
  int is_v3_ctor;
  int is_v3_ctor;
  int is_v3_dtor;
  int is_v3_dtor;
  int ret_postfix;
  int ret_postfix, ret_drop;
  struct line format;
  struct line format;
  struct line input;
  struct line input;
  struct line expect;
  struct line expect;
  char *result;
  char *result;
  int failures = 0;
  int failures = 0;
Line 207... Line 208...
 
 
      tests++;
      tests++;
 
 
      no_params = 0;
      no_params = 0;
      ret_postfix = 0;
      ret_postfix = 0;
 
      ret_drop = 0;
      is_v3_ctor = 0;
      is_v3_ctor = 0;
      is_v3_dtor = 0;
      is_v3_dtor = 0;
      if (format.data[0] == '\0')
      if (format.data[0] == '\0')
        style = auto_demangling;
        style = auto_demangling;
      else if (format.data[0] != '-')
      else if (format.data[0] != '-')
Line 263... Line 265...
                is_v3_ctor = 1;
                is_v3_ctor = 1;
              else if (strcmp (opt, "--is-v3-dtor") == 0)
              else if (strcmp (opt, "--is-v3-dtor") == 0)
                is_v3_dtor = 1;
                is_v3_dtor = 1;
              else if (strcmp (opt, "--ret-postfix") == 0)
              else if (strcmp (opt, "--ret-postfix") == 0)
                ret_postfix = 1;
                ret_postfix = 1;
 
              else if (strcmp (opt, "--ret-drop") == 0)
 
                ret_drop = 1;
              else
              else
                {
                {
                  printf ("FAIL at line %d: unrecognized option %s\n",
                  printf ("FAIL at line %d: unrecognized option %s\n",
                          lineno, opt);
                          lineno, opt);
                  failures++;
                  failures++;
Line 305... Line 309...
          continue;
          continue;
        }
        }
 
 
      cplus_demangle_set_style (style);
      cplus_demangle_set_style (style);
 
 
      result = cplus_demangle (inp,
      result = cplus_demangle (inp, (DMGL_PARAMS | DMGL_ANSI | DMGL_TYPES
                               DMGL_PARAMS|DMGL_ANSI|DMGL_TYPES
                                     | (ret_postfix ? DMGL_RET_POSTFIX : 0)
                               |(ret_postfix ? DMGL_RET_POSTFIX : 0));
                                     | (ret_drop ? DMGL_RET_DROP : 0)));
 
 
      if (result
      if (result
          ? strcmp (result, expect.data)
          ? strcmp (result, expect.data)
          : strcmp (input.data, expect.data))
          : strcmp (input.data, expect.data))
        {
        {

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.