diff options
Diffstat (limited to 'gcc-4.8.1/gcc/testsuite/objc.dg/torture')
24 files changed, 0 insertions, 763 deletions
diff --git a/gcc-4.8.1/gcc/testsuite/objc.dg/torture/dg-torture.exp b/gcc-4.8.1/gcc/testsuite/objc.dg/torture/dg-torture.exp deleted file mode 100644 index 4b1869e9c..000000000 --- a/gcc-4.8.1/gcc/testsuite/objc.dg/torture/dg-torture.exp +++ /dev/null @@ -1,17 +0,0 @@ -# This harness is for tests that should be run at all optimisation levels. - -load_lib objc-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 can also run code with the NeXT runtime. -if [istarget "*-*-darwin*" ] { - objc-dg-runtest $tests "-fnext-runtime" -} - -dg-finish diff --git a/gcc-4.8.1/gcc/testsuite/objc.dg/torture/forward-1.m b/gcc-4.8.1/gcc/testsuite/objc.dg/torture/forward-1.m deleted file mode 100644 index b45f1b444..000000000 --- a/gcc-4.8.1/gcc/testsuite/objc.dg/torture/forward-1.m +++ /dev/null @@ -1,89 +0,0 @@ -/* { dg-do run } */ -/* See if -forward:: is able to work. */ -/* { dg-skip-if "Needs OBJC2 Implementation" { *-*-darwin8* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } } */ - -#include <stdio.h> -#include <stdlib.h> - -#include "../../objc-obj-c++-shared/TestsuiteObject.m" - -#define VALUETOUSE 1234567890 - -id forwarder, receiver; - -@interface Forwarder: TestsuiteObject -{ - id receiver; -} - --initWithReceiver:theReceiver; - -@end - -@interface Receiver:TestsuiteObject -{ - int foo; -} --display; --initWithFoo:(int)theFoo; -@end -@implementation Receiver - --initWithFoo: (int)theFoo -{ - foo = theFoo; - return self; -} - --display -{ - printf ("Executing display\n"); - /* Check to see if we are really the reciever. */ - if (self != receiver) - abort (); - /* And the value of foo is set correctly. */ - if (foo != VALUETOUSE) - abort (); - return self; -} - -@end - -@implementation Forwarder --initWithReceiver: theReceiver -{ - [super init]; - receiver = theReceiver; - return self; -} --(void *) forward: (SEL)theSel: (void *)theArgFrame -{ - /* If we have a reciever try to perform on that object */ - if (receiver) - { - /* Simple forward that works for methods with no - arguments. */ - typedef id (*method_with_no_args) (id receiver, SEL _cmd); - Method method = class_getInstanceMethod (object_getClass (receiver), - theSel); - method_with_no_args imp = (method_with_no_args)(method_getImplementation - (method)); - return (*imp)(receiver, theSel); - } - - /* Normally you'd emit an error here. */ - printf ("Unrecognized selector\n"); - return NULL; -} -@end -int main() -{ - /* Init the reciever. */ - receiver = [[Receiver alloc] initWithFoo: VALUETOUSE]; - /* Init the fowarder. */ - forwarder = [[Forwarder alloc] initWithReceiver: receiver]; - /* Call display on the forwarder which in turns calls display on - the reciever. */ - [forwarder display]; - exit(0); -} diff --git a/gcc-4.8.1/gcc/testsuite/objc.dg/torture/strings/const-cfstring-1.m b/gcc-4.8.1/gcc/testsuite/objc.dg/torture/strings/const-cfstring-1.m deleted file mode 100644 index 7e9891564..000000000 --- a/gcc-4.8.1/gcc/testsuite/objc.dg/torture/strings/const-cfstring-1.m +++ /dev/null @@ -1,62 +0,0 @@ -/* 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 <zlaski@apple.com>. */ - -/* 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 <Foundation/NSString.h> -#import <CoreFoundation/CFString.h> -#include <stdlib.h> - -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-4.8.1/gcc/testsuite/objc.dg/torture/strings/const-cfstring-3.m b/gcc-4.8.1/gcc/testsuite/objc.dg/torture/strings/const-cfstring-3.m deleted file mode 100644 index 4a6142988..000000000 --- a/gcc-4.8.1/gcc/testsuite/objc.dg/torture/strings/const-cfstring-3.m +++ /dev/null @@ -1,27 +0,0 @@ -/* Test for assigning compile-time constant-string objects to static variables. */ -/* Contributed by Ziemowit Laski <zlaski@apple.com> */ - -/* 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 <stdlib.h> - -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-4.8.1/gcc/testsuite/objc.dg/torture/strings/const-cfstring-4.m b/gcc-4.8.1/gcc/testsuite/objc.dg/torture/strings/const-cfstring-4.m deleted file mode 100644 index 1155db5f8..000000000 --- a/gcc-4.8.1/gcc/testsuite/objc.dg/torture/strings/const-cfstring-4.m +++ /dev/null @@ -1,21 +0,0 @@ -/* 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 <zlaski@apple.com> */ - -/* 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-4.8.1/gcc/testsuite/objc.dg/torture/strings/const-str-10.m b/gcc-4.8.1/gcc/testsuite/objc.dg/torture/strings/const-str-10.m deleted file mode 100644 index e35b83bdc..000000000 --- a/gcc-4.8.1/gcc/testsuite/objc.dg/torture/strings/const-str-10.m +++ /dev/null @@ -1,36 +0,0 @@ -/* Test if ObjC constant string layout is checked properly, regardless of how - constant string classes get derived. */ -/* Contributed by Ziemowit Laski <zlaski@apple.com> */ - -/* { dg-do compile { target { *-*-darwin* } } } */ -/* { dg-skip-if "" { *-*-* } { "-fgnu-runtime" } { "" } } */ -/* { dg-options "-mno-constant-cfstrings" { target *-*-darwin* } } */ - -#include <objc/Object.h> -#include "../../../objc-obj-c++-shared/runtime.h" /* For NEXT_OBJC_USE_NEW_INTERFACE. */ - -@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-4.8.1/gcc/testsuite/objc.dg/torture/strings/const-str-11.m b/gcc-4.8.1/gcc/testsuite/objc.dg/torture/strings/const-str-11.m deleted file mode 100644 index 765f6489f..000000000 --- a/gcc-4.8.1/gcc/testsuite/objc.dg/torture/strings/const-str-11.m +++ /dev/null @@ -1,36 +0,0 @@ -/* Test if ObjC constant string layout is checked properly, regardless of how - constant string classes get derived. */ -/* Contributed by Ziemowit Laski <zlaski@apple.com> */ - -/* { 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/Object.h> -#include "../../../objc-obj-c++-shared/runtime.h" /* For NEXT_OBJC_USE_NEW_INTERFACE. */ - -@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-4.8.1/gcc/testsuite/objc.dg/torture/strings/const-str-3.m b/gcc-4.8.1/gcc/testsuite/objc.dg/torture/strings/const-str-3.m deleted file mode 100644 index 0eb2d6a01..000000000 --- a/gcc-4.8.1/gcc/testsuite/objc.dg/torture/strings/const-str-3.m +++ /dev/null @@ -1,54 +0,0 @@ -/* Test the -fconstant-string-class=Foo option under the NeXT runtime. */ -/* Developed by Markus Hitter <mah@jump-ing.de>. */ -/* { 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 <stdio.h> -#include <stdlib.h> -#include <string.h> - -@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-4.8.1/gcc/testsuite/objc.dg/torture/strings/const-str-4.m b/gcc-4.8.1/gcc/testsuite/objc.dg/torture/strings/const-str-4.m deleted file mode 100644 index 446b075da..000000000 --- a/gcc-4.8.1/gcc/testsuite/objc.dg/torture/strings/const-str-4.m +++ /dev/null @@ -1,32 +0,0 @@ -/* Ensure that the preprocessor handles ObjC string constants gracefully. */ -/* Author: Ziemowit Laski <zlaski@apple.com> */ -/* { 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-4.8.1/gcc/testsuite/objc.dg/torture/strings/const-str-7.m b/gcc-4.8.1/gcc/testsuite/objc.dg/torture/strings/const-str-7.m deleted file mode 100644 index 4c190904a..000000000 --- a/gcc-4.8.1/gcc/testsuite/objc.dg/torture/strings/const-str-7.m +++ /dev/null @@ -1,43 +0,0 @@ -/* Test to make sure that the const objc strings are the same across scopes. */ -/* Developed by Andrew Pinski <pinskia@physics.uc.edu> */ -/* { dg-do run } */ -/* { dg-options "-fconstant-string-class=Foo " } */ -/* { dg-options "-mno-constant-cfstrings -fconstant-string-class=Foo" { target *-*-darwin* } } */ - -#include "../../../objc-obj-c++-shared/TestsuiteObject.m" -#include <stdio.h> -#include <stdlib.h> -#include <string.h> - -@interface Foo: TestsuiteObject { - char *cString; - unsigned int len; -} -- (char *)customString; -@end - -#ifdef __NEXT_RUNTIME__ -#ifdef NEXT_OBJC_USE_NEW_INTERFACE -Class _FooClassReference; -#else -struct objc_class _FooClassReference; -#endif -#endif - -@implementation Foo : TestsuiteObject -- (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-4.8.1/gcc/testsuite/objc.dg/torture/strings/const-str-8.m b/gcc-4.8.1/gcc/testsuite/objc.dg/torture/strings/const-str-8.m deleted file mode 100644 index 9b6d23fbf..000000000 --- a/gcc-4.8.1/gcc/testsuite/objc.dg/torture/strings/const-str-8.m +++ /dev/null @@ -1,44 +0,0 @@ -/* Test for assigning compile-time constant-string objects to static variables. */ -/* Contributed by Ziemowit Laski <zlaski@apple.com> */ -/* { dg-do run } */ -/* { dg-options "-fconstant-string-class=Foo" } */ -/* { dg-options "-mno-constant-cfstrings -fconstant-string-class=Foo" { target *-*-darwin* } } */ - -#include "../../../objc-obj-c++-shared/TestsuiteObject.m" -#include <stdlib.h> - -@interface Foo: TestsuiteObject { - char *cString; - unsigned int len; -} -@end - -#ifdef __NEXT_RUNTIME__ -#ifdef NEXT_OBJC_USE_NEW_INTERFACE -Class _FooClassReference; -#else -struct objc_class _FooClassReference; -#endif -#endif - -@implementation Foo : TestsuiteObject -- (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-4.8.1/gcc/testsuite/objc.dg/torture/strings/const-str-9.m b/gcc-4.8.1/gcc/testsuite/objc.dg/torture/strings/const-str-9.m deleted file mode 100644 index e69fb0180..000000000 --- a/gcc-4.8.1/gcc/testsuite/objc.dg/torture/strings/const-str-9.m +++ /dev/null @@ -1,28 +0,0 @@ -/* Test if ObjC constant strings get placed in the correct section. */ -/* Contributed by Ziemowit Laski <zlaski@apple.com> */ - -/* { dg-do compile } */ -/* { dg-skip-if "" { *-*-* } { "-fgnu-runtime" } { "" } } */ -/* { dg-options "-mno-constant-cfstrings" { target *-*-darwin* } } */ - -#include <objc/Object.h> -#include "../../../objc-obj-c++-shared/runtime.h" /* For NEXT_OBJC_USE_NEW_INTERFACE. */ - -@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-4.8.1/gcc/testsuite/objc.dg/torture/strings/string1.m b/gcc-4.8.1/gcc/testsuite/objc.dg/torture/strings/string1.m deleted file mode 100644 index 455b5f1bf..000000000 --- a/gcc-4.8.1/gcc/testsuite/objc.dg/torture/strings/string1.m +++ /dev/null @@ -1,22 +0,0 @@ -/* 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 <string.h> -#include <stdlib.h> - -#ifndef __NEXT_RUNTIME__ -#include <objc/NXConstStr.h> -#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-4.8.1/gcc/testsuite/objc.dg/torture/strings/string2.m b/gcc-4.8.1/gcc/testsuite/objc.dg/torture/strings/string2.m deleted file mode 100644 index 030ba602d..000000000 --- a/gcc-4.8.1/gcc/testsuite/objc.dg/torture/strings/string2.m +++ /dev/null @@ -1,23 +0,0 @@ -/* 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 <string.h> -#include <stdlib.h> - -#ifndef __NEXT_RUNTIME__ -#include <objc/NXConstStr.h> -#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-4.8.1/gcc/testsuite/objc.dg/torture/strings/string3.m b/gcc-4.8.1/gcc/testsuite/objc.dg/torture/strings/string3.m deleted file mode 100644 index b08dfb242..000000000 --- a/gcc-4.8.1/gcc/testsuite/objc.dg/torture/strings/string3.m +++ /dev/null @@ -1,24 +0,0 @@ -/* 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 <string.h> -#include <stdlib.h> - -#ifndef __NEXT_RUNTIME__ -#include <objc/NXConstStr.h> -#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-4.8.1/gcc/testsuite/objc.dg/torture/strings/string4.m b/gcc-4.8.1/gcc/testsuite/objc.dg/torture/strings/string4.m deleted file mode 100644 index 425ccc080..000000000 --- a/gcc-4.8.1/gcc/testsuite/objc.dg/torture/strings/string4.m +++ /dev/null @@ -1,22 +0,0 @@ -/* 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 <string.h> -#include <stdlib.h> - -#ifndef __NEXT_RUNTIME__ -#include <objc/NXConstStr.h> -#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-4.8.1/gcc/testsuite/objc.dg/torture/strings/strings.exp b/gcc-4.8.1/gcc/testsuite/objc.dg/torture/strings/strings.exp deleted file mode 100644 index e4d10eab9..000000000 --- a/gcc-4.8.1/gcc/testsuite/objc.dg/torture/strings/strings.exp +++ /dev/null @@ -1,34 +0,0 @@ -# String tests that should be run at all optimization levels. - -# Copyright (C) 2010-2013 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 -# <http://www.gnu.org/licenses/>. - -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 diff --git a/gcc-4.8.1/gcc/testsuite/objc.dg/torture/tls/diag-1.m b/gcc-4.8.1/gcc/testsuite/objc.dg/torture/tls/diag-1.m deleted file mode 100644 index 7c3245d9f..000000000 --- a/gcc-4.8.1/gcc/testsuite/objc.dg/torture/tls/diag-1.m +++ /dev/null @@ -1,12 +0,0 @@ -// Valid __thread specifiers. -// { dg-require-effective-target tls } - -__thread int g1; -extern __thread int g2; -static __thread int g3; - -void foo() -{ - extern __thread int l1; - static __thread int l2; -} diff --git a/gcc-4.8.1/gcc/testsuite/objc.dg/torture/tls/thr-init-2.m b/gcc-4.8.1/gcc/testsuite/objc.dg/torture/tls/thr-init-2.m deleted file mode 100644 index cdbef4d77..000000000 --- a/gcc-4.8.1/gcc/testsuite/objc.dg/torture/tls/thr-init-2.m +++ /dev/null @@ -1,43 +0,0 @@ -// { dg-do run } -// { dg-require-effective-target tls_runtime } -// { dg-add-options tls } - -extern void _exit(int); - -__thread int glb =1 ; - -static __thread int fstat = 2; - -int fa(int a) -{ -static __thread int as = 3; - as += a ; - return as; -} - -int fb(int b) -{ -static __thread int bs = 4; - bs += b ; - glb = bs; - return bs; -} - -int main (int ac, char *av[]) -{ - int a = 1; - - a = fa(fstat); - if ( a != 5 ) - _exit (-(__LINE__)) ; - - a = fa(glb); - if ( a != 6 ) - _exit (-(__LINE__)) ; - - a = fb(a); - if ( a != 10 || glb != 10 ) - _exit (-(__LINE__)) ; - - return 0; -} diff --git a/gcc-4.8.1/gcc/testsuite/objc.dg/torture/tls/thr-init-3.m b/gcc-4.8.1/gcc/testsuite/objc.dg/torture/tls/thr-init-3.m deleted file mode 100644 index 5fd29a84d..000000000 --- a/gcc-4.8.1/gcc/testsuite/objc.dg/torture/tls/thr-init-3.m +++ /dev/null @@ -1,38 +0,0 @@ -/* { dg-do run } */ -/* { dg-require-effective-target tls_runtime } */ -/* { dg-add-options tls } */ -/* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } } */ - -#include "../../../objc-obj-c++-shared/TestsuiteObject.m" -extern void _exit(int); - -@interface tsObj: TestsuiteObject { - int ai ; -} - -- (int) fa:(int) n; - -@end - -@implementation tsObj - -- (int) fa:(int) n -{ -static __thread int as = 3; - as += n ; - return as ; -} - -@end - -int main (int ac, char *av[]) -{ - int a ; - tsObj *to = [tsObj new]; - - a = [to fa:5]; - if ( a != 8 ) - _exit (-(__LINE__)) ; - - return 0; -} diff --git a/gcc-4.8.1/gcc/testsuite/objc.dg/torture/tls/thr-init.m b/gcc-4.8.1/gcc/testsuite/objc.dg/torture/tls/thr-init.m deleted file mode 100644 index 986b425f7..000000000 --- a/gcc-4.8.1/gcc/testsuite/objc.dg/torture/tls/thr-init.m +++ /dev/null @@ -1,26 +0,0 @@ -/* { dg-do run } */ -/* { dg-require-effective-target tls_runtime } */ -/* { dg-add-options tls } */ - -extern void _exit(int); - -static __thread int fstat ; - -static __thread int fstat = 1; - -static __thread int fstat ; - -int test_code(int b) -{ - fstat += b ; - return fstat; -} - -int main (int ac, char *av[]) -{ - int a = test_code(1); - - if ( a != 2 || fstat != 2 ) _exit (-(__LINE__)) ; - - return 0; -} diff --git a/gcc-4.8.1/gcc/testsuite/objc.dg/torture/tls/tls.exp b/gcc-4.8.1/gcc/testsuite/objc.dg/torture/tls/tls.exp deleted file mode 100644 index 4b1869e9c..000000000 --- a/gcc-4.8.1/gcc/testsuite/objc.dg/torture/tls/tls.exp +++ /dev/null @@ -1,17 +0,0 @@ -# This harness is for tests that should be run at all optimisation levels. - -load_lib objc-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 can also run code with the NeXT runtime. -if [istarget "*-*-darwin*" ] { - objc-dg-runtest $tests "-fnext-runtime" -} - -dg-finish diff --git a/gcc-4.8.1/gcc/testsuite/objc.dg/torture/tls/trivial.m b/gcc-4.8.1/gcc/testsuite/objc.dg/torture/tls/trivial.m deleted file mode 100644 index e2b8f45b8..000000000 --- a/gcc-4.8.1/gcc/testsuite/objc.dg/torture/tls/trivial.m +++ /dev/null @@ -1,3 +0,0 @@ -// { dg-require-effective-target tls } - -__thread int i; diff --git a/gcc-4.8.1/gcc/testsuite/objc.dg/torture/trivial.m b/gcc-4.8.1/gcc/testsuite/objc.dg/torture/trivial.m deleted file mode 100644 index 8ca4b3c32..000000000 --- a/gcc-4.8.1/gcc/testsuite/objc.dg/torture/trivial.m +++ /dev/null @@ -1,10 +0,0 @@ -/* { dg-do run } */ -/* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } } */ - -#import "../../objc-obj-c++-shared/TestsuiteObject.m" - -int main(void) -{ - [TestsuiteObject class]; - return 0; -} |