aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicola Pero <nicola.pero@meta-innovation.com>2010-09-08 18:03:25 +0000
committerNicola Pero <nicola@gcc.gnu.org>2010-09-08 18:03:25 +0000
commitbd72fc7cd4e91ac2297c14bc62980c6506e8c56c (patch)
treed47fa3e9b1b66054d03f706e420a88c38e65cded
parent4470254f1a06ae1fe9548902f079d2dd8bc74692 (diff)
downloadgcc-bd72fc7cd4e91ac2297c14bc62980c6506e8c56c.zip
gcc-bd72fc7cd4e91ac2297c14bc62980c6506e8c56c.tar.gz
gcc-bd72fc7cd4e91ac2297c14bc62980c6506e8c56c.tar.bz2
type-stream-1.m: Replaced with a test that tests that functions from objc/typedstream.h are...
* objc.dg/type-stream-1.m: Replaced with a test that tests that functions from objc/typedstream.h are deprecated. From-SVN: r164016
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/objc.dg/type-stream-1.m32
2 files changed, 17 insertions, 20 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index f533013..0b5454c 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -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
diff --git a/gcc/testsuite/objc.dg/type-stream-1.m b/gcc/testsuite/objc.dg/type-stream-1.m
index 33a3091..9f2d509 100644
--- a/gcc/testsuite/objc.dg/type-stream-1.m
+++ b/gcc/testsuite/objc.dg/type-stream-1.m
@@ -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" } */
+}