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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [obj-c++.dg/] [demangle-1.mm] - Rev 703

Compare with Previous | Blame | View Log

/* Test demangling a C++ function.  */
/* { dg-do run } */

#include <cstring>
#include <cstdlib>
#include <iostream>

class demangle_test
{
public:
  /* Return 0 if the demangling test succeeds.  */
  static int test_function1 ()
  {
    std::cout << __PRETTY_FUNCTION__ << "\n";
    return std::strcmp (__PRETTY_FUNCTION__, "static int demangle_test::test_function1()");
  }

  /* Return 0 if the demangling test succeeds.  */
  static int test_function2 (int ignored)
  {
    std::cout << __PRETTY_FUNCTION__ << "\n";
    return std::strcmp (__PRETTY_FUNCTION__, "static int demangle_test::test_function2(int)");
  }
};

int main ()
{
  if (demangle_test::test_function1 () != 0)
    abort ();

  if (demangle_test::test_function2 (0) != 0)
    abort ();
  
  return 0;
}

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

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