From 81f88bc2d512abb58adc4be552c91d198bd56a26 Mon Sep 17 00:00:00 2001 From: zlaski Date: Tue, 14 Oct 2003 00:38:48 +0000 Subject: [PATCH] 2003-10-13 Ziemowit Laski * objc/execute/_cmd.m: Fix typo. * objc.dg/image-info.m, objc.dg/symtab-1.m: Relax 'scan-assembler' regexp. * objc.dg/try-catch-1.m, objc.dg/try-catch-3.m, objc.dg/try-catch-4.m: Run on non-Darwin targets. * objc.dg/zero-link-2.m: Remove blank line. * objc.dg/zero-link-3.m: New test case. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@72455 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/testsuite/ChangeLog | 10 ++++++++++ gcc/testsuite/objc.dg/image-info.m | 2 +- gcc/testsuite/objc.dg/symtab-1.m | 2 +- gcc/testsuite/objc.dg/try-catch-1.m | 9 ++++----- gcc/testsuite/objc.dg/try-catch-3.m | 4 ++-- gcc/testsuite/objc.dg/try-catch-4.m | 4 ++-- gcc/testsuite/objc.dg/zero-link-2.m | 1 - gcc/testsuite/objc.dg/zero-link-3.m | 24 ++++++++++++++++++++++++ gcc/testsuite/objc/execute/_cmd.m | 2 +- 9 files changed, 45 insertions(+), 13 deletions(-) create mode 100644 gcc/testsuite/objc.dg/zero-link-3.m diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 24435f3..5cdd008 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,13 @@ +2003-10-13 Ziemowit Laski + + * objc/execute/_cmd.m: Fix typo. + * objc.dg/image-info.m, objc.dg/symtab-1.m: + Relax 'scan-assembler' regexp. + * objc.dg/try-catch-1.m, objc.dg/try-catch-3.m, + objc.dg/try-catch-4.m: Run on non-Darwin targets. + * objc.dg/zero-link-2.m: Remove blank line. + * objc.dg/zero-link-3.m: New test case. + 2003-10-13 Geoffrey Keating * g77.f-torture/execute/980520-1.x: XFAIL at -O0. diff --git a/gcc/testsuite/objc.dg/image-info.m b/gcc/testsuite/objc.dg/image-info.m index 84e6ad8..5ba3fa4 100644 --- a/gcc/testsuite/objc.dg/image-info.m +++ b/gcc/testsuite/objc.dg/image-info.m @@ -35,4 +35,4 @@ extern void abort(void); } @end -/* { dg-final { scan-assembler "\n.data\n.section __OBJC, __image_info\n\t.align.*\nL_OBJC_IMAGE_INFO:\n\t.long\t0\n\t.long\t1\n.data\n.objc_module_info\n" } } */ +/* { dg-final { scan-assembler "\n.data\n.section __OBJC, __image_info\n\t.align.*\nL_OBJC_IMAGE_INFO.*:\n\t.long\t0\n\t.long\t1\n.data\n.objc_module_info\n" } } */ diff --git a/gcc/testsuite/objc.dg/symtab-1.m b/gcc/testsuite/objc.dg/symtab-1.m index 44e7b5a..d031cb4 100644 --- a/gcc/testsuite/objc.dg/symtab-1.m +++ b/gcc/testsuite/objc.dg/symtab-1.m @@ -21,4 +21,4 @@ -(void)checkValues { } @end -/* { dg-final { scan-assembler "L_OBJC_SYMBOLS:\n\t.long\t0\n\t.long\t0\n\t.short\t2\n\t.short\t0\n\t.long\tL_OBJC_CLASS_Derived\n\t.long\tL_OBJC_CLASS_Base\n" } } */ +/* { dg-final { scan-assembler "L_OBJC_SYMBOLS.*:\n\t.long\t0\n\t.long\t0\n\t.short\t2\n\t.short\t0\n\t.long\tL_OBJC_CLASS_Derived.*\n\t.long\tL_OBJC_CLASS_Base.*\n" } } */ diff --git a/gcc/testsuite/objc.dg/try-catch-1.m b/gcc/testsuite/objc.dg/try-catch-1.m index e40fdf8..4ba8620 100644 --- a/gcc/testsuite/objc.dg/try-catch-1.m +++ b/gcc/testsuite/objc.dg/try-catch-1.m @@ -1,11 +1,10 @@ /* Test if the compiler accepts @throw / @try..@catch..@finally - syntax. This will only be usable on MacOS X 10.3 and later. */ + syntax. This will only be usable on MacOS X 10.3 and later, + but may be compiled on all targets. */ /* Developed by Ziemowit Laski . */ -/* { dg-options "-fobjc-exceptions" } */ -/* { dg-do compile { target *-*-darwin* } } */ +/* { dg-options "-fnext-runtime -fobjc-exceptions" } */ +/* { dg-do compile } */ -#include -#include #include #include #include diff --git a/gcc/testsuite/objc.dg/try-catch-3.m b/gcc/testsuite/objc.dg/try-catch-3.m index f49362f..b79b494 100644 --- a/gcc/testsuite/objc.dg/try-catch-3.m +++ b/gcc/testsuite/objc.dg/try-catch-3.m @@ -2,8 +2,8 @@ @catch block. (Yes, I managed to break this.) */ /* Author: Ziemowit Laski */ -/* { dg-do compile { target *-*-darwin* } } */ -/* { dg-options "-fobjc-exceptions" } */ +/* { dg-do compile } */ +/* { dg-options "-fnext-runtime -fobjc-exceptions" } */ #include diff --git a/gcc/testsuite/objc.dg/try-catch-4.m b/gcc/testsuite/objc.dg/try-catch-4.m index 54aea23..b9c28da 100644 --- a/gcc/testsuite/objc.dg/try-catch-4.m +++ b/gcc/testsuite/objc.dg/try-catch-4.m @@ -2,8 +2,8 @@ exceptions being caught by previous @catch blocks. */ /* Author: Ziemowit Laski */ -/* { dg-do compile { target *-*-darwin* } } */ -/* { dg-options "-Wall -fobjc-exceptions" } */ +/* { dg-do compile } */ +/* { dg-options "-Wall -fnext-runtime -fobjc-exceptions" } */ @interface Exception @end diff --git a/gcc/testsuite/objc.dg/zero-link-2.m b/gcc/testsuite/objc.dg/zero-link-2.m index 92b4ab1..8fba042 100644 --- a/gcc/testsuite/objc.dg/zero-link-2.m +++ b/gcc/testsuite/objc.dg/zero-link-2.m @@ -25,4 +25,3 @@ int main(void) { /* { dg-final { scan-assembler "_OBJC_CLASS_REFERENCES_0" } } */ /* { dg-final { scan-assembler-not "objc_getClass" } } */ - diff --git a/gcc/testsuite/objc.dg/zero-link-3.m b/gcc/testsuite/objc.dg/zero-link-3.m new file mode 100644 index 0000000..af624ab --- /dev/null +++ b/gcc/testsuite/objc.dg/zero-link-3.m @@ -0,0 +1,24 @@ +/* Check that the '-fzero-link' flag doesn't prevent messaging from working. */ +/* Contributed by Ziemowit Laski . */ +/* { dg-options "-fnext-runtime -fzero-link -lobjc" } */ +/* { dg-do run { target *-*-darwin* } } */ + +#import +#import + +extern void abort(void); +#define CHECK_IF(expr) if(!(expr)) abort(); + +@interface Base: Object ++ (int) getValue; +@end + +@implementation Base ++ (int) getValue { return 1593; } +@end + +int main(void) { + int val = [Base getValue]; + CHECK_IF(val == 1593); + return 0; +} diff --git a/gcc/testsuite/objc/execute/_cmd.m b/gcc/testsuite/objc/execute/_cmd.m index f2b05b6..72c555e 100644 --- a/gcc/testsuite/objc/execute/_cmd.m +++ b/gcc/testsuite/objc/execute/_cmd.m @@ -14,7 +14,7 @@ @end @implementation TestClass -+ (const char*) method; ++ (const char*) method { return sel_get_name (_cmd); } -- 2.7.4