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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [objc.dg/] [exceptions-7.m] - Blame information for rev 724

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

Line No. Rev Author Line
1 704 jeremybenn
/* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, December 2010.  */
2
/* { dg-options "-fobjc-exceptions" } */
3
/* { dg-do compile } */
4
 
5
/* Test warnings when the argument of @throw is invalid.  */
6
 
7
#include <objc/objc.h>
8
 
9
void test (id object)
10
{
11
  struct x { int i; } invalid_1, *invalid_2;
12
 
13
  @throw object;    /* Ok */
14
  @throw 1;         /* { dg-error ".@throw. argument is not an object" } */
15
  @throw "string";  /* { dg-error ".@throw. argument is not an object" } */
16
  @throw invalid_1; /* { dg-error ".@throw. argument is not an object" } */
17
  @throw invalid_2; /* { dg-error ".@throw. argument is not an object" } */
18
}

powered by: WebSVN 2.1.0

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