* objc.dg/type-stream-1.m: Replaced with a test that tests that
authornicola <nicola@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 8 Sep 2010 18:03:25 +0000 (18:03 +0000)
committernicola <nicola@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 8 Sep 2010 18:03:25 +0000 (18:03 +0000)
        functions from objc/typedstream.h are deprecated.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@164016 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/testsuite/ChangeLog
gcc/testsuite/objc.dg/type-stream-1.m

index f533013..0b5454c 100644 (file)
@@ -1,3 +1,8 @@
+2010-09-06  Nicola Pero  <nicola.pero@meta-innovation.com>
+
+       * objc.dg/type-stream-1.m: Replaced with a test that tests that
+       functions from objc/typedstream.h are deprecated.
+
 2010-09-08  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
 
        * lib/target-supports.exp
index 33a3091..9f2d509 100644 (file)
@@ -1,25 +1,17 @@
-/* { dg-do run } */
+/* { dg-do compile } */
 /* { dg-skip-if "" { *-*-* } { "-fnext-runtime" } { "" } } */
+
+/* Test warning for deprecated typedstream functions.  These functions
+   will be removed in the release after 4.6.0, at which point this
+   testcase can be removed too.
+ */
+
 #include <objc/typedstream.h>
-#include <stdio.h>
-#include <stdlib.h>
 
-int main (void)
+void dummy (void)
 {
-  FILE *f; TypedStream *ts;
-  struct T { int a, b; } x = { 1, 2 };
-  f = fopen ("foo", "w"); ts = objc_open_typed_stream (f, OBJC_WRITEONLY);
-  objc_write_type (ts, @encode(struct T), &x);
-  objc_close_typed_stream (ts); fclose (f);
-  f = fopen ("foo", "r"); ts = objc_open_typed_stream (f, OBJC_READONLY);
-  struct T y;
-  objc_read_type (ts, @encode(struct T), &y);
-  if (y.a != 1)
-   abort ();
-  if (y.b != 2)
-   abort ();
-  objc_close_typed_stream (ts); fclose (f);
-  remove ("foo");
-  return 0;
-}
+  TypedStream* t = objc_open_typed_stream_for_file ("dummy", 0); /* { dg-warning "deprecated" } */
 
+  objc_write_object (t, nil); /* { dg-warning "deprecated" } */
+  objc_read_object (t, NULL);  /* { dg-warning "deprecated" } */
+}