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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [obj-c++.dg/] [try-catch-12.mm] - Rev 703

Compare with Previous | Blame | View Log

/* Ensure that typeof()-typed variables inside the @try { } block that
   "inherit" their EH-volatileness from other variables in the stack frame
   do not trigger "discards qualifiers from target pointer type" warnings.  */

/* { dg-options "-fobjc-exceptions" } */
/* { dg-do compile } */

typedef volatile int IOSharedLockData;

@interface TestMyTests
- (void) testSpoon;
@end

extern void some_func (int *);

@implementation TestMyTests
- (void) testSpoon {
  int i = 5;

  do {
    @try {
      typeof(i) j = 6;
      some_func (&j);
    }
    @catch (id exc) {
      @throw;
    }
  } while(0);

  do {
    @try {
      typeof(i) j = 7;
      some_func (&j);
    }
    @catch (id exc) {
      @throw;
    }
  } while(0);

  do {
    @try {
      typeof(i) j = 8;
      some_func (&j);
    }
    @catch (id exc) {
      @throw;
    }
  } while(0);
      
}
@end

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.