_cmd.m: Fix typo.
authorZiemowit Laski <zlaski@apple.com>
Tue, 14 Oct 2003 00:38:48 +0000 (00:38 +0000)
committerZiemowit Laski <zlaski@gcc.gnu.org>
Tue, 14 Oct 2003 00:38:48 +0000 (00:38 +0000)
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.

From-SVN: r72455

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 24435f306d2bc5fb05f8b8a8f9904cba5e92d03c..5cdd008b57fc5e6702ba7640adf14a8ae553c915 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 84e6ad8d0e27a59dcca8ce15ad3201478af03a2a..5ba3fa4f904bd0c918095b310702bafc04f31024 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 44e7b5aab3409ecf179a5c639c77a11dbb6c5e2d..d031cb46d06fa3547ebf8f84bf0ca606907dc286 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 e40fdf85994edc182244cce95f431dec64be483a..4ba86207bd9b550167edcd0fcf668e70e964e2c0 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 f49362fbf3191a9da0229afb0cd278a9f4098934..b79b494d18228738e6b6ee4fa891ff30331ab372 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 54aea233fed2e8c8518d1e10058c3ab1ed3de63f..b9c28daeb18d89a5f28b108a87d1b342c1b67ae1 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 92b4ab11b0c254798676eb30f7d1b22e5a901dd0..8fba04230b61d48a009e1644c788bdf5e589bf06 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 f2b05b6527b7a6e81ffd9daa4ddb390e00e2f55a..72c555e6d429586033bc674ecd61a507fd7c1d0b 100644 (file)
@@ -14,7 +14,7 @@
 @end
 
 @implementation TestClass
-+ (const char*) method;
++ (const char*) method
 {
   return sel_get_name (_cmd);
 }