From 554fd8c5195424bdbcabf5de30fdc183aba391bd Mon Sep 17 00:00:00 2001 From: upstream source tree Date: Sun, 15 Mar 2015 20:14:05 -0400 Subject: obtained gcc-4.6.4.tar.bz2 from upstream website; verified gcc-4.6.4.tar.bz2.sig; imported gcc-4.6.4 source tree from verified upstream tarball. downloading a git-generated archive based on the 'upstream' tag should provide you with a source tree that is binary identical to the one extracted from the above tarball. if you have obtained the source via the command 'git clone', however, do note that line-endings of files in your working directory might differ from line-endings of the respective files in the upstream repository. --- .../objc.dg/torture/strings/const-cfstring-1.m | 62 ++++++++++++++++++++++ .../objc.dg/torture/strings/const-cfstring-3.m | 27 ++++++++++ .../objc.dg/torture/strings/const-cfstring-4.m | 21 ++++++++ .../objc.dg/torture/strings/const-str-10.m | 35 ++++++++++++ .../objc.dg/torture/strings/const-str-11.m | 35 ++++++++++++ .../objc.dg/torture/strings/const-str-3.m | 54 +++++++++++++++++++ .../objc.dg/torture/strings/const-str-4.m | 32 +++++++++++ .../objc.dg/torture/strings/const-str-7.m | 42 +++++++++++++++ .../objc.dg/torture/strings/const-str-8.m | 43 +++++++++++++++ .../objc.dg/torture/strings/const-str-9.m | 27 ++++++++++ gcc/testsuite/objc.dg/torture/strings/string1.m | 22 ++++++++ gcc/testsuite/objc.dg/torture/strings/string2.m | 23 ++++++++ gcc/testsuite/objc.dg/torture/strings/string3.m | 24 +++++++++ gcc/testsuite/objc.dg/torture/strings/string4.m | 22 ++++++++ gcc/testsuite/objc.dg/torture/strings/strings.exp | 34 ++++++++++++ 15 files changed, 503 insertions(+) create mode 100644 gcc/testsuite/objc.dg/torture/strings/const-cfstring-1.m create mode 100644 gcc/testsuite/objc.dg/torture/strings/const-cfstring-3.m create mode 100644 gcc/testsuite/objc.dg/torture/strings/const-cfstring-4.m create mode 100644 gcc/testsuite/objc.dg/torture/strings/const-str-10.m create mode 100644 gcc/testsuite/objc.dg/torture/strings/const-str-11.m create mode 100644 gcc/testsuite/objc.dg/torture/strings/const-str-3.m create mode 100644 gcc/testsuite/objc.dg/torture/strings/const-str-4.m create mode 100644 gcc/testsuite/objc.dg/torture/strings/const-str-7.m create mode 100644 gcc/testsuite/objc.dg/torture/strings/const-str-8.m create mode 100644 gcc/testsuite/objc.dg/torture/strings/const-str-9.m create mode 100644 gcc/testsuite/objc.dg/torture/strings/string1.m create mode 100644 gcc/testsuite/objc.dg/torture/strings/string2.m create mode 100644 gcc/testsuite/objc.dg/torture/strings/string3.m create mode 100644 gcc/testsuite/objc.dg/torture/strings/string4.m create mode 100644 gcc/testsuite/objc.dg/torture/strings/strings.exp (limited to 'gcc/testsuite/objc.dg/torture/strings') diff --git a/gcc/testsuite/objc.dg/torture/strings/const-cfstring-1.m b/gcc/testsuite/objc.dg/torture/strings/const-cfstring-1.m new file mode 100644 index 000000000..7e9891564 --- /dev/null +++ b/gcc/testsuite/objc.dg/torture/strings/const-cfstring-1.m @@ -0,0 +1,62 @@ +/* Test the -fconstant-cfstrings option for constructing + compile-time immutable CFStrings, and their interoperation + with both Cocoa and CoreFoundation. This will only work + on MacOS X 10.1.2 and later. */ +/* Developed by Ziemowit Laski . */ + +/* So far, CFString is darwin-only. */ +/* { dg-do run { target *-*-darwin* } } */ +/* { dg-skip-if "NeXT only" { *-*-* } { "-fgnu-runtime" } { "" } } */ +/* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } } */ +/* { dg-options "-mconstant-cfstrings -framework Cocoa" } */ +/* Darwin10's linker emits a warning that the constant strings are incompatible with writable ones. + Well, we don't implement writable ones at this juncture. */ +/* { dg-options "-mconstant-cfstrings -framework Cocoa -Wl,-w" { target *-*-darwin[123]* } } */ + +#import +#import +#include + +void printOut(NSString *str) { + NSLog(@"The value of str is: %@", str); +} + +CFStringRef s0a = CFSTR("Compile-time string literal"); +CFStringRef s0b = CFSTR("Compile-time string literal"); + +void checkNSRange(NSRange r) { + if (r.location != 6 || r.length != 5) { + printOut(@"Range check failed"); + abort(); + } +} + +void checkCFRange(CFRange r) { + if (r.location != 6 || r.length != 5) { + printOut(@"Range check failed"); + abort(); + } +} + +int main(void) { + const NSString *s1 = @"Compile-time string literal"; + CFStringRef s2 = CFSTR("Compile-time string literal"); + + checkNSRange([@"Hello World" rangeOfString:@"World"]); + checkNSRange([(id)CFSTR("Hello World") rangeOfString:@"World"]); + checkNSRange([@"Hello World" rangeOfString:(id)CFSTR("World")]); + checkNSRange([(id)CFSTR("Hello World") rangeOfString:(id)CFSTR("World")]); + + checkCFRange(CFStringFind((CFStringRef)@"Hello World", (CFStringRef)@"World", 0)); + checkCFRange(CFStringFind(CFSTR("Hello World"), (CFStringRef)@"World", 0)); + checkCFRange(CFStringFind((CFStringRef)@"Hello World", CFSTR("World"), 0)); + checkCFRange(CFStringFind(CFSTR("Hello World"), CFSTR("World"), 0)); + + /* Check for string uniquing. */ + if (s0a != s0b || s0a != s2 || s1 != (id)s2) { + NSLog(@"String uniquing failed"); + abort (); + } + + return 0; +} diff --git a/gcc/testsuite/objc.dg/torture/strings/const-cfstring-3.m b/gcc/testsuite/objc.dg/torture/strings/const-cfstring-3.m new file mode 100644 index 000000000..4a6142988 --- /dev/null +++ b/gcc/testsuite/objc.dg/torture/strings/const-cfstring-3.m @@ -0,0 +1,27 @@ +/* Test for assigning compile-time constant-string objects to static variables. */ +/* Contributed by Ziemowit Laski */ + +/* So far, CFString is darwin-only. */ +/* { dg-do run { target *-*-darwin* } } */ +/* { dg-skip-if "NeXT only" { *-*-* } { "-fgnu-runtime" } { "" } } */ +/* { dg-options "-mconstant-cfstrings -framework Foundation" } */ + +#include + +typedef const struct __CFString * CFStringRef; +static CFStringRef appKey = (CFStringRef) @"com.apple.soundpref"; + +static int CFPreferencesSynchronize (CFStringRef ref) { + return ref == appKey; +} + +static void PrefsSynchronize() +{ + if(!CFPreferencesSynchronize(appKey)) + abort(); +} + +int main(void) { + PrefsSynchronize(); + return 0; +} diff --git a/gcc/testsuite/objc.dg/torture/strings/const-cfstring-4.m b/gcc/testsuite/objc.dg/torture/strings/const-cfstring-4.m new file mode 100644 index 000000000..1155db5f8 --- /dev/null +++ b/gcc/testsuite/objc.dg/torture/strings/const-cfstring-4.m @@ -0,0 +1,21 @@ +/* Test if constant CFStrings get placed in the correct section and that the + layout of the object is correct for both m32 and m64. */ +/* Contributed by Ziemowit Laski */ + +/* So far, CFString is darwin-only. */ +/* { dg-do compile { target *-*-darwin* } } */ +/* { dg-skip-if "NeXT only" { *-*-* } { "-fgnu-runtime" } { "" } } */ +/* { dg-options "-mconstant-cfstrings" } */ + +typedef const struct __CFString * CFStringRef; +static CFStringRef appKey = (CFStringRef) @"com.apple.soundpref"; + +void *foo (void) +{ + void *a = (void *)appKey; + return a; +} + +/* { dg-final { scan-assembler ".section __DATA, __cfstring" } } */ +/* { dg-final { scan-assembler ".long\t___CFConstantStringClassReference\n\t.long\t1992\n\t.long\t.*\n\t.long\t19\n" { target { *-*-darwin* && { ! lp64 } } } } } */ +/* { dg-final { scan-assembler ".quad\t___CFConstantStringClassReference\n\t.long\t1992\n\t.space 4\n\t.quad\t.*\n\t.quad\t19\n" { target { *-*-darwin* && { lp64 } } } } } */ diff --git a/gcc/testsuite/objc.dg/torture/strings/const-str-10.m b/gcc/testsuite/objc.dg/torture/strings/const-str-10.m new file mode 100644 index 000000000..f0f28238d --- /dev/null +++ b/gcc/testsuite/objc.dg/torture/strings/const-str-10.m @@ -0,0 +1,35 @@ +/* Test if ObjC constant string layout is checked properly, regardless of how + constant string classes get derived. */ +/* Contributed by Ziemowit Laski */ + +/* { dg-do compile { target { *-*-darwin* } } } */ +/* { dg-skip-if "" { *-*-* } { "-fgnu-runtime" } { "" } } */ +/* { dg-options "-mno-constant-cfstrings" { target *-*-darwin* } } */ + +#include "../../../objc-obj-c++-shared/Object1.h" + +@interface NSString: Object +@end + +@interface NSSimpleCString : NSString { +@protected + char *bytes; + unsigned int numBytes; +} +@end + +@interface NSConstantString : NSSimpleCString +@end + +#ifndef NEXT_OBJC_USE_NEW_INTERFACE +extern struct objc_class _NSConstantStringClassReference; +#else +extern Class _NSConstantStringClassReference; +#endif + +const NSConstantString *appKey = @"MyApp"; + +/* { dg-final { scan-assembler ".section __OBJC, __cstring_object" { target { *-*-darwin* && { ! lp64 } } } } } */ +/* { dg-final { scan-assembler ".section __DATA, __objc_stringobj" { target { *-*-darwin* && { lp64 } } } } } */ +/* { dg-final { scan-assembler ".long\t__NSConstantStringClassReference\n\t.long\t.*\n\t.long\t5\n\t.data" { target { *-*-darwin* && { ! lp64 } } } } } */ +/* { dg-final { scan-assembler ".quad\t_OBJC_CLASS_._NSConstantString\n\t.quad\t.*\n\t.long\t5\n\t.space" { target { *-*-darwin* && { lp64 } } } } } */ diff --git a/gcc/testsuite/objc.dg/torture/strings/const-str-11.m b/gcc/testsuite/objc.dg/torture/strings/const-str-11.m new file mode 100644 index 000000000..fa9dbd985 --- /dev/null +++ b/gcc/testsuite/objc.dg/torture/strings/const-str-11.m @@ -0,0 +1,35 @@ +/* Test if ObjC constant string layout is checked properly, regardless of how + constant string classes get derived. */ +/* Contributed by Ziemowit Laski */ + +/* { dg-do compile { target *-*-darwin* } } */ +/* { dg-skip-if "" { *-*-* } { "-fgnu-runtime" } { "" } } */ +/* { dg-options "-fconstant-string-class=XStr" } */ +/* { dg-options "-mno-constant-cfstrings -fconstant-string-class=XStr" { target *-*-darwin* } } */ + +#include "../../../objc-obj-c++-shared/Object1.h" + +@interface XString: Object { +@protected + char *bytes; +} +@end + +@interface XStr : XString { +@public + unsigned int len; +} +@end + +#ifndef NEXT_OBJC_USE_NEW_INTERFACE +extern struct objc_class _XStrClassReference; +#else +extern Class _XStrClassReference; +#endif + +const XStr *appKey = @"MyApp"; + +/* { dg-final { scan-assembler ".section __OBJC, __cstring_object" { target { *-*-darwin* && { ! lp64 } } } } } */ +/* { dg-final { scan-assembler ".section __DATA, __objc_stringobj" { target { *-*-darwin* && { lp64 } } } } } */ +/* { dg-final { scan-assembler ".long\t__XStrClassReference\n\t.long\t.*\n\t.long\t5\n\t.data" { target { *-*-darwin* && { ! lp64 } } } } } */ +/* { dg-final { scan-assembler ".quad\t_OBJC_CLASS_._XStr\n\t.quad\t.*\n\t.long\t5\n\t.space" { target { *-*-darwin* && { lp64 } } } } } */ diff --git a/gcc/testsuite/objc.dg/torture/strings/const-str-3.m b/gcc/testsuite/objc.dg/torture/strings/const-str-3.m new file mode 100644 index 000000000..0eb2d6a01 --- /dev/null +++ b/gcc/testsuite/objc.dg/torture/strings/const-str-3.m @@ -0,0 +1,54 @@ +/* Test the -fconstant-string-class=Foo option under the NeXT runtime. */ +/* Developed by Markus Hitter . */ +/* { dg-do run } */ +/* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } } */ +/* { dg-options "-fconstant-string-class=Foo" } */ +/* { dg-options "-mno-constant-cfstrings -fconstant-string-class=Foo" { target *-*-darwin* } } */ + +#include "../../../objc-obj-c++-shared/objc-test-suite-types.h" + +#include +#include +#include + +@interface Foo { + void *dummy_class_ref; + char *cString; + unsigned int len; +} ++ initialize; +- (char *)customString; +@end + +TNS_STRING_REF_T _FooClassReference; /* Only used by NeXT. */ + +@implementation Foo ++ initialize {return self;} + +- (char *)customString { + return cString; +} +@end + +int main () { + Foo *string = @"bla"; + Foo *string2 = @"bla"; + + if(string != string2) + abort(); + printf("Strings are being uniqued properly\n"); + +#ifdef __NEXT_RUNTIME__ + /* This memcpy has to be done before the first message is sent to a + constant string object. Can't be moved to +initialize since _that_ + is already a message. */ + + memcpy(&_FooClassReference, objc_getClass("Foo"), sizeof(_FooClassReference)); +#endif + if (strcmp ([string customString], "bla")) { + abort (); + } + + printf([@"This is a working constant string object\n" customString]); + return 0; +} diff --git a/gcc/testsuite/objc.dg/torture/strings/const-str-4.m b/gcc/testsuite/objc.dg/torture/strings/const-str-4.m new file mode 100644 index 000000000..446b075da --- /dev/null +++ b/gcc/testsuite/objc.dg/torture/strings/const-str-4.m @@ -0,0 +1,32 @@ +/* Ensure that the preprocessor handles ObjC string constants gracefully. */ +/* Author: Ziemowit Laski */ +/* { dg-do run } */ +/* { dg-options "-fconstant-string-class=MyString " } */ +/* { dg-options "-mno-constant-cfstrings -fconstant-string-class=MyString " { target *-*-darwin* } } */ + +extern void abort(void); + +@interface MyString +{ + void *isa; + char *str; + int len; +} +@end + +#define kMyStringMacro1 "My String" +#define kMyStringMacro2 @"My String" + +void *_MyStringClassReference; + +@implementation MyString +@end + +int main(void) { + MyString* aString1 = @kMyStringMacro1; + MyString* aString2 = kMyStringMacro2; + if(aString1 != aString2) { + abort(); + } + return 0; +} diff --git a/gcc/testsuite/objc.dg/torture/strings/const-str-7.m b/gcc/testsuite/objc.dg/torture/strings/const-str-7.m new file mode 100644 index 000000000..7221e28d4 --- /dev/null +++ b/gcc/testsuite/objc.dg/torture/strings/const-str-7.m @@ -0,0 +1,42 @@ +/* Test to make sure that the const objc strings are the same across scopes. */ +/* Developed by Andrew Pinski */ +/* { dg-do run } */ +/* { dg-options "-fconstant-string-class=Foo " } */ +/* { dg-options "-mno-constant-cfstrings -fconstant-string-class=Foo" { target *-*-darwin* } } */ +/* { dg-additional-sources "../../../objc-obj-c++-shared/Object1.m" } */ + +#include "../../../objc-obj-c++-shared/Object1.h" +#include +#include +#include + +@interface Foo: Object { + char *cString; + unsigned int len; +} +- (char *)customString; +@end + +#ifdef NEXT_OBJC_USE_NEW_INTERFACE +Class _FooClassReference; +#else +struct objc_class _FooClassReference; +#endif + +@implementation Foo : Object +- (char *)customString { + return cString; +} +@end + +int main () { + Foo *string = @"bla"; + { + Foo *string2 = @"bla"; + + if(string != string2) + abort(); + printf("Strings are being uniqued properly\n"); + } + return 0; +} diff --git a/gcc/testsuite/objc.dg/torture/strings/const-str-8.m b/gcc/testsuite/objc.dg/torture/strings/const-str-8.m new file mode 100644 index 000000000..c5bacaf43 --- /dev/null +++ b/gcc/testsuite/objc.dg/torture/strings/const-str-8.m @@ -0,0 +1,43 @@ +/* Test for assigning compile-time constant-string objects to static variables. */ +/* Contributed by Ziemowit Laski */ +/* { dg-do run } */ +/* { dg-options "-fconstant-string-class=Foo" } */ +/* { dg-options "-mno-constant-cfstrings -fconstant-string-class=Foo" { target *-*-darwin* } } */ +/* { dg-additional-sources "../../../objc-obj-c++-shared/Object1.m" } */ + +#include "../../../objc-obj-c++-shared/Object1.h" +#include + +@interface Foo: Object { + char *cString; + unsigned int len; +} +@end + +#ifdef NEXT_OBJC_USE_NEW_INTERFACE +Class _FooClassReference; +#else +struct objc_class _FooClassReference; +#endif + +@implementation Foo : Object +- (char *)customString { + return cString; +} +@end + +static const Foo *appKey = @"MyApp"; +static int CFPreferencesSynchronize (const Foo *ref) { + return ref == appKey; +} + +static void PrefsSynchronize(void) +{ + if(!CFPreferencesSynchronize(appKey)) + abort(); +} + +int main () { + PrefsSynchronize(); + return 0; +} diff --git a/gcc/testsuite/objc.dg/torture/strings/const-str-9.m b/gcc/testsuite/objc.dg/torture/strings/const-str-9.m new file mode 100644 index 000000000..39bd10274 --- /dev/null +++ b/gcc/testsuite/objc.dg/torture/strings/const-str-9.m @@ -0,0 +1,27 @@ +/* Test if ObjC constant strings get placed in the correct section. */ +/* Contributed by Ziemowit Laski */ + +/* { dg-do compile } */ +/* { dg-skip-if "" { *-*-* } { "-fgnu-runtime" } { "" } } */ +/* { dg-options "-mno-constant-cfstrings" { target *-*-darwin* } } */ + +#include "../../../objc-obj-c++-shared/Object1.h" + +@interface NSConstantString: Object { + char *cString; + unsigned int len; +} +@end + +#ifndef NEXT_OBJC_USE_NEW_INTERFACE +extern struct objc_class _NSConstantStringClassReference; +#else +Class _NSConstantStringClassReference; +#endif + +const NSConstantString *appKey = @"MyApp"; + +/* { dg-final { scan-assembler ".section __OBJC, __cstring_object" { target { *-*-darwin* && { ! lp64 } } } } } */ +/* { dg-final { scan-assembler ".section __DATA, __objc_stringobj" { target { *-*-darwin* && { lp64 } } } } } */ +/* { dg-final { scan-assembler ".long\t__NSConstantStringClassReference\n\t.long\t.*\n\t.long\t5\n\t.data" { target { *-*-darwin* && { ! lp64 } } } } } */ +/* { dg-final { scan-assembler ".quad\t_OBJC_CLASS_._NSConstantString\n\t.quad\t.*\n\t.long\t5\n\t.space" { target { *-*-darwin* && { lp64 } } } } } */ diff --git a/gcc/testsuite/objc.dg/torture/strings/string1.m b/gcc/testsuite/objc.dg/torture/strings/string1.m new file mode 100644 index 000000000..455b5f1bf --- /dev/null +++ b/gcc/testsuite/objc.dg/torture/strings/string1.m @@ -0,0 +1,22 @@ +/* Based on a test case contributed by Nicola Pero. */ + +/* { dg-do run } */ +/* { dg-options "-mno-constant-cfstrings -Wno-deprecated-declarations" { target *-*-darwin* } } */ +/* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } } */ +/* { dg-additional-sources "../../../objc-obj-c++-shared/nsconstantstring-class-impl.m" } */ + +#include +#include + +#ifndef __NEXT_RUNTIME__ +#include +#else +#include "../../../objc-obj-c++-shared/nsconstantstring-class.h" +#endif + +int main(int argc, void **args) +{ + if (strcmp ([@"this is a string" cString], "this is a string")) + abort (); + return 0; +} diff --git a/gcc/testsuite/objc.dg/torture/strings/string2.m b/gcc/testsuite/objc.dg/torture/strings/string2.m new file mode 100644 index 000000000..030ba602d --- /dev/null +++ b/gcc/testsuite/objc.dg/torture/strings/string2.m @@ -0,0 +1,23 @@ +/* Based on a test case contributed by Nicola Pero. */ + +/* { dg-do run } */ +/* { dg-options "-mno-constant-cfstrings -Wno-deprecated-declarations" { target *-*-darwin* } } */ +/* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } } */ +/* { dg-additional-sources "../../../objc-obj-c++-shared/nsconstantstring-class-impl.m" } */ + +#include +#include + +#ifndef __NEXT_RUNTIME__ +#include +#else +#include "../../../objc-obj-c++-shared/nsconstantstring-class.h" +#endif + +int main(int argc, void **args) +{ + if (strcmp ([@"this " @"is " @"a " @"string" cString], + "this " "is " "a " "string")) + abort (); + return 0; +} diff --git a/gcc/testsuite/objc.dg/torture/strings/string3.m b/gcc/testsuite/objc.dg/torture/strings/string3.m new file mode 100644 index 000000000..b08dfb242 --- /dev/null +++ b/gcc/testsuite/objc.dg/torture/strings/string3.m @@ -0,0 +1,24 @@ +/* Based on a test case contributed by Nicola Pero. */ + +/* { dg-do run } */ +/* { dg-options "-mno-constant-cfstrings -Wno-deprecated-declarations" { target *-*-darwin* } } */ +/* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } } */ +/* { dg-additional-sources "../../../objc-obj-c++-shared/nsconstantstring-class-impl.m" } */ + +#include +#include + +#ifndef __NEXT_RUNTIME__ +#include +#else +#include "../../../objc-obj-c++-shared/nsconstantstring-class.h" +#endif + +#define STRING "this is a string" + +int main (int argc, void **args) +{ + if (strcmp ([@STRING cString], STRING)) + abort (); + return 0; +} diff --git a/gcc/testsuite/objc.dg/torture/strings/string4.m b/gcc/testsuite/objc.dg/torture/strings/string4.m new file mode 100644 index 000000000..425ccc080 --- /dev/null +++ b/gcc/testsuite/objc.dg/torture/strings/string4.m @@ -0,0 +1,22 @@ +/* Based on a test case contributed by Nicola Pero. */ + +/* { dg-do run } */ +/* { dg-options "-mno-constant-cfstrings -Wno-deprecated-declarations" { target *-*-darwin* } } */ +/* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } } */ +/* { dg-additional-sources "../../../objc-obj-c++-shared/nsconstantstring-class-impl.m" } */ + +#include +#include + +#ifndef __NEXT_RUNTIME__ +#include +#else +#include "../../../objc-obj-c++-shared/nsconstantstring-class.h" +#endif + +int main(int argc, void **args) +{ + if ([@"this is a string" length] != strlen ("this is a string")) + abort (); + return 0; +} diff --git a/gcc/testsuite/objc.dg/torture/strings/strings.exp b/gcc/testsuite/objc.dg/torture/strings/strings.exp new file mode 100644 index 000000000..e30918613 --- /dev/null +++ b/gcc/testsuite/objc.dg/torture/strings/strings.exp @@ -0,0 +1,34 @@ +# String tests that should be run at all optimization levels. + +# Copyright (C) 2010 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GCC; see the file COPYING3. If not see +# . + +load_lib objc-dg.exp +load_lib target-supports-dg.exp + +dg-init + +# Gather a list of all tests. +set tests [lsort [glob -nocomplain $srcdir/$subdir/*.m]] + +objc-dg-runtest $tests "-fgnu-runtime" + +# Darwin targets also test with the NeXT runtime. +if [istarget "*-*-darwin*" ] { + objc-dg-runtest $tests "-fnext-runtime" +} + +dg-finish -- cgit v1.2.3