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

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [g++.dg/] [warn/] [noreturn-1.C] - Diff between revs 301 and 338

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

Rev 301 Rev 338
// Test that noreturn attributes are properly set.
// Test that noreturn attributes are properly set.
// Origin: Kaveh Ghazi  2002-06-18.
// Origin: Kaveh Ghazi  2002-06-18.
// { dg-do compile }
// { dg-do compile }
// { dg-options "-Wall -O2" }
// { dg-options "-Wall -O2" }
#include 
#include 
int foo1 (int i)
int foo1 (int i)
{
{
  switch (i)
  switch (i)
    {
    {
    case 1:
    case 1:
    case 2:
    case 2:
      return i;
      return i;
    }
    }
  abort();
  abort();
}
}
int foo2 (int i)
int foo2 (int i)
{
{
  switch (i)
  switch (i)
    {
    {
    case 1:
    case 1:
    case 2:
    case 2:
      return i;
      return i;
    }
    }
  std::abort();
  std::abort();
}
}
int foo3 (int i)
int foo3 (int i)
{
{
  switch (i)
  switch (i)
    {
    {
    case 1:
    case 1:
    case 2:
    case 2:
      return i;
      return i;
    }
    }
  exit(1);
  exit(1);
}
}
int foo4 (int i)
int foo4 (int i)
{
{
  switch (i)
  switch (i)
    {
    {
    case 1:
    case 1:
    case 2:
    case 2:
      return i;
      return i;
    }
    }
  std::exit(1);
  std::exit(1);
}
}
void __attribute__ ((__noreturn__)) foo5 ()
void __attribute__ ((__noreturn__)) foo5 ()
{
{
  abort();
  abort();
}
}
void __attribute__ ((__noreturn__)) foo6 ()
void __attribute__ ((__noreturn__)) foo6 ()
{
{
  std::abort();
  std::abort();
}
}
void __attribute__ ((__noreturn__)) foo7 ()
void __attribute__ ((__noreturn__)) foo7 ()
{
{
  exit(1);
  exit(1);
}
}
void __attribute__ ((__noreturn__)) foo8 ()
void __attribute__ ((__noreturn__)) foo8 ()
{
{
  std::exit(1);
  std::exit(1);
}
}
 
 

powered by: WebSVN 2.1.0

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