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

Subversion Repositories scarts

[/] [scarts/] [trunk/] [toolchain/] [scarts-gcc/] [gcc-4.1.1/] [gcc/] [testsuite/] [g++.dg/] [opt/] [pr7503-5.C] - Rev 12

Compare with Previous | Blame | View Log

// PR c++/7503
// { dg-do run }
// { dg-options "-O2 -Wno-deprecated" }

extern "C" void abort();

void test1a()
{
  int A = 4;
  int B = 4;

  A >?= B++;
  if (A != 4 || B != 5)
    abort ();
}

void test1b()
{
  int A = 3;
  int B = 5;

  A >?= B++;
  if (A != 5 || B != 6)
    abort ();
}

void test1c()
{
  int A = 5;
  int B = 3;

  A >?= B++;
  if (A != 5 || B != 4)
    abort ();
}


void test2a()
{
  int A = 4;
  int B = 4;

  A <?= B++;
  if (A != 4 || B != 5)
    abort ();
}

void test2b()
{
  int A = 3;
  int B = 5;

  A <?= B++;
  if (A != 3 || B != 6)
    abort ();
}

void test2c()
{
  int A = 5;
  int B = 3;

  A <?= B++;
  if (A != 3 || B != 4)
    abort ();
}


int main()
{
  test1a();
  test1b();
  test1c();

  test2a();
  test2b();
  test2c();

  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.