1 /* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, November 2010. */
2 /* { dg-do compile } */
4 #include "../objc-obj-c++-shared/Object1.h"
5 #include "../objc-obj-c++-shared/next-mapping.h"
6 #ifndef __NEXT_RUNTIME__
7 #include <objc/NXConstStr.h>
10 /* The following are correct. */
11 id test_valid1 = @"test";
12 id test_valid2 = @"te" @"st";
13 id test_valid3 = @"te" @"s" @"t";
14 id test_valid4 = @ "t" @ "e" @ "s" @ "t";
16 /* The following are accepted too; you can concat an ObjC string to a
17 C string, the result being an ObjC string. */
18 id test_valid5 = @"te" "st";
19 id test_valid6 = @"te" "s" @"t";
20 id test_valid7 = @"te" @"s" "t";
22 /* The following are not correct. */
23 id test_invalid1 = @@"test"; /* { dg-error "stray .@. in program" } */
24 const char *test_invalid2 = "test"@; /* { dg-error "stray .@. in program" } */
25 const char *test_invalid3 = "test"@@; /* { dg-error "stray .@. in program" } */
26 const char *test_invalid4 = "te" @"st"; /* { dg-error "expected" } */
27 id test_invalid5 = @"te" @@"st"; /* { dg-error "repeated .@. before Objective-C string" } */
28 id test_invalid6 = @@"te" @"st"; /* { dg-error "stray .@. in program" } */
29 id test_invalid7 = @"te" @"s" @@"t"; /* { dg-error "repeated .@. before Objective-C string" } */
30 id test_invalid8 = @"te" @@"s" @"t"; /* { dg-error "repeated .@. before Objective-C string" } */
31 id test_invalid9 = @"te" @"s" @"t" @; /* { dg-error "stray .@. in program" } */
32 id test_invalidA = @"te" @ st; /* { dg-error "stray .@. in program" } */
33 /* { dg-error "expected" "" { target *-*-* } 32 } */