2003-10-13 Ziemowit Laski <zlaski@apple.com>
authorzlaski <zlaski@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 14 Oct 2003 00:38:48 +0000 (00:38 +0000)
committerzlaski <zlaski@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 14 Oct 2003 00:38:48 +0000 (00:38 +0000)
        * 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
gcc/testsuite/objc.dg/image-info.m
gcc/testsuite/objc.dg/symtab-1.m
gcc/testsuite/objc.dg/try-catch-1.m
gcc/testsuite/objc.dg/try-catch-3.m
gcc/testsuite/objc.dg/try-catch-4.m
gcc/testsuite/objc.dg/zero-link-2.m
gcc/testsuite/objc.dg/zero-link-3.m [new file with mode: 0644]
gcc/testsuite/objc/execute/_cmd.m

index 24435f3..5cdd008 100644 (file)
@@ -1,3 +1,13 @@
+2003-10-13  Ziemowit Laski  <zlaski@apple.com>
+
+       * 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  <geoffk@apple.com>
 
        * g77.f-torture/execute/980520-1.x: XFAIL at -O0.
index 84e6ad8..5ba3fa4 100644 (file)
@@ -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" } } */
index 44e7b5a..d031cb4 100644 (file)
@@ -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" } } */
index e40fdf8..4ba8620 100644 (file)
@@ -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 <zlaski@apple.com>.  */
-/* { dg-options "-fobjc-exceptions" } */
-/* { dg-do compile { target *-*-darwin* } } */
+/* { dg-options "-fnext-runtime -fobjc-exceptions" } */
+/* { dg-do compile } */
 
-#include <objc/objc.h>
-#include <objc/objc-runtime.h>
 #include <objc/Object.h>
 #include <stdio.h>
 #include <setjmp.h>
index f49362f..b79b494 100644 (file)
@@ -2,8 +2,8 @@
    @catch block.  (Yes, I managed to break this.)  */
 /* Author: Ziemowit Laski <zlaski@apple.com> */
 
-/* { dg-do compile { target *-*-darwin* } } */
-/* { dg-options "-fobjc-exceptions" } */
+/* { dg-do compile } */
+/* { dg-options "-fnext-runtime -fobjc-exceptions" } */
 
 #include <objc/Object.h>
 
index 54aea23..b9c28da 100644 (file)
@@ -2,8 +2,8 @@
    exceptions being caught by previous @catch blocks.  */
 /* Author: Ziemowit Laski <zlaski@apple.com> */
 
-/* { dg-do compile { target *-*-darwin* } } */
-/* { dg-options "-Wall -fobjc-exceptions" } */
+/* { dg-do compile } */
+/* { dg-options "-Wall -fnext-runtime -fobjc-exceptions" } */
 
 @interface Exception
 @end
index 92b4ab1..8fba042 100644 (file)
@@ -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 (file)
index 0000000..af624ab
--- /dev/null
@@ -0,0 +1,24 @@
+/* Check that the '-fzero-link' flag doesn't prevent messaging from working. */
+/* Contributed by Ziemowit Laski <zlaski@apple.com>.  */
+/* { dg-options "-fnext-runtime -fzero-link -lobjc" } */
+/* { dg-do run { target *-*-darwin* } } */
+
+#import <objc/objc.h>
+#import <objc/Object.h>
+
+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;
+}
index f2b05b6..72c555e 100644 (file)
@@ -14,7 +14,7 @@
 @end
 
 @implementation TestClass
-+ (const char*) method;
++ (const char*) method
 {
   return sel_get_name (_cmd);
 }