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

Subversion Repositories openrisc

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

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>, November 2010.  */
2
/* { dg-options "-fobjc-exceptions" } */
3
/* { dg-do compile } */
4
 
5
/* Test warnings when parsing syntax errors in @throw.  */
6
 
7
#include <objc/objc.h>
8
 
9
void test (id object)
10
{
11
  @throw object;   /* Ok */
12
  @throw;          /* { dg-error ".@throw. .rethrow. used outside of a @catch block" } */
13
  @throw (object); /* Ok.  */
14
  @throw (id)0
15
}                  /* { dg-error "expected" } */
16
 
17
void test2 (id object)
18
{
19
  @throw object);  /* { dg-error "expected" } */
20
  @throw (...);    /* { dg-error "expected" } */
21
  @throw ();       /* { dg-error "expected" } */
22
  @throw
23
}                  /* { dg-error "expected" } */
24
 
25
void test3 (id object1, id object2)
26
{
27
  /* This is apparently valid.  */
28
  @throw object1, object2; /* Ok.  */
29
}

powered by: WebSVN 2.1.0

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