From: nicola Date: Wed, 8 Sep 2010 18:03:25 +0000 (+0000) Subject: * objc.dg/type-stream-1.m: Replaced with a test that tests that X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=735232df4918a42d5c3d75b1e1a10d2b2c55a075;p=thirdparty%2Fgcc.git * objc.dg/type-stream-1.m: Replaced with a test that tests that functions from objc/typedstream.h are deprecated. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@164016 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index f53301342982..0b5454c93d91 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2010-09-06 Nicola Pero + + * 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 * 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 33a30914f8e8..9f2d509fbf78 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 -#include -#include -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" } */ +}