OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [g++.old-deja/] [g++.ext/] [pretty3.C] - Diff between revs 305 and 338

Only display areas with differences | Details | Blame | View Log

Rev 305 Rev 338
// { dg-do run  }
// { dg-do run  }
// Copyright (C) 1999 Free Software Foundation, Inc.
// Copyright (C) 1999 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 21 Nov 1999 
// Contributed by Nathan Sidwell 21 Nov 1999 
// make sure __FUNCTION__ and __PRETTY_FUNCTION__ work in templates
// make sure __FUNCTION__ and __PRETTY_FUNCTION__ work in templates
#include 
#include 
#include 
#include 
static bool bad = false;
static bool bad = false;
template void f1 (T)
template void f1 (T)
{
{
  char const *function = __FUNCTION__;
  char const *function = __FUNCTION__;
  char const *pretty = __PRETTY_FUNCTION__;
  char const *pretty = __PRETTY_FUNCTION__;
  printf ("generic\n");
  printf ("generic\n");
  printf ("__FUNCTION__ %s\n", function);
  printf ("__FUNCTION__ %s\n", function);
  printf ("__PRETTY_FUNCTION__ %s\n", pretty);
  printf ("__PRETTY_FUNCTION__ %s\n", pretty);
  if (strcmp (function, "f1"))
  if (strcmp (function, "f1"))
    bad = true;
    bad = true;
  if (strcmp (pretty, "void f1(T) [with T = float]")) // only for float instantiation
  if (strcmp (pretty, "void f1(T) [with T = float]")) // only for float instantiation
    bad = true;
    bad = true;
}
}
template<> void f1 (int)
template<> void f1 (int)
{
{
  char const *function = __FUNCTION__;
  char const *function = __FUNCTION__;
  char const *pretty = __PRETTY_FUNCTION__;
  char const *pretty = __PRETTY_FUNCTION__;
  printf ("specialized\n");
  printf ("specialized\n");
  printf ("__FUNCTION__ %s\n", function);
  printf ("__FUNCTION__ %s\n", function);
  printf ("__PRETTY_FUNCTION__ %s\n", pretty);
  printf ("__PRETTY_FUNCTION__ %s\n", pretty);
  if (strcmp (function, "f1"))
  if (strcmp (function, "f1"))
    bad = true;
    bad = true;
  if (strcmp (pretty, "void f1(T) [with T = int]"))
  if (strcmp (pretty, "void f1(T) [with T = int]"))
    bad = true;
    bad = true;
}
}
int main ()
int main ()
{
{
  f1(0);    // f1
  f1(0);    // f1
  f1(0.0f); // f1
  f1(0.0f); // f1
  return bad;
  return bad;
}
}
 
 

powered by: WebSVN 2.1.0

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