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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [obj-c++.dg/] [exceptions-7.mm] - Rev 724

Go to most recent revision | Compare with Previous | Blame | View Log

/* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, December 2010.  */
/* { dg-options "-fobjc-exceptions" } */
/* { dg-do compile } */

/* Test warnings when the argument of @throw is invalid.  */

#include <objc/objc.h>

void test (id object)
{
  struct x { int i; } invalid_1, *invalid_2;

  @throw object;    /* Ok */
  @throw 1;         /* { dg-error ".@throw. argument is not an object" } */
  @throw "string";  /* { dg-error ".@throw. argument is not an object" } */
  @throw invalid_1; /* { dg-error ".@throw. argument is not an object" } */
  @throw invalid_2; /* { dg-error ".@throw. argument is not an object" } */
}

Go to most recent revision | 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.