URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Details |
Compare with Previous |
View Log
Line No. |
Rev |
Author |
Line |
1 |
703 |
jeremybenn |
/* Contributed by Nicola Pero , November 2010. */
|
2 |
|
|
/* { dg-do compile } */
|
3 |
|
|
|
4 |
|
|
#include "../../objc-obj-c++-shared/runtime.h"
|
5 |
|
|
#ifndef __NEXT_RUNTIME__
|
6 |
|
|
#include
|
7 |
|
|
#endif
|
8 |
|
|
|
9 |
|
|
/* The following are correct. */
|
10 |
|
|
id test_valid1 = @"test";
|
11 |
|
|
id test_valid2 = @"te" @"st";
|
12 |
|
|
id test_valid3 = @"te" @"s" @"t";
|
13 |
|
|
id test_valid4 = @ "t" @ "e" @ "s" @ "t";
|
14 |
|
|
|
15 |
|
|
/* The following are accepted too; you can concat an ObjC string to a
|
16 |
|
|
C string, the result being an ObjC string. */
|
17 |
|
|
id test_valid5 = @"te" "st";
|
18 |
|
|
id test_valid6 = @"te" "s" @"t";
|
19 |
|
|
id test_valid7 = @"te" @"s" "t";
|
20 |
|
|
|
21 |
|
|
/* The following are not correct. */
|
22 |
|
|
id test_invalid1 = @@"test"; /* { dg-error "stray .@. in program" } */
|
23 |
|
|
const char *test_invalid2 = "test"@; /* { dg-error "stray .@. in program" } */
|
24 |
|
|
const char *test_invalid3 = "test"@@; /* { dg-error "stray .@. in program" } */
|
25 |
|
|
const char *test_invalid4 = "te" @"st"; /* { dg-error "expected" } */
|
26 |
|
|
id test_invalid5 = @"te" @@"st"; /* { dg-error "repeated .@. before Objective-C string" } */
|
27 |
|
|
id test_invalid6 = @@"te" @"st"; /* { dg-error "stray .@. in program" } */
|
28 |
|
|
id test_invalid7 = @"te" @"s" @@"t"; /* { dg-error "repeated .@. before Objective-C string" } */
|
29 |
|
|
id test_invalid8 = @"te" @@"s" @"t"; /* { dg-error "repeated .@. before Objective-C string" } */
|
30 |
|
|
id test_invalid9 = @"te" @"s" @"t" @; /* { dg-error "stray .@. in program" } */
|
31 |
|
|
id test_invalidA = @"te" @ st; /* { dg-error "stray .@. in program" } */
|
32 |
|
|
/* { dg-error "expected" "" { target *-*-* } 31 } */
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.