Commit bd72fc7c by Nicola Pero Committed by Nicola Pero

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
parent 4470254f
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> 2010-09-08 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* lib/target-supports.exp * lib/target-supports.exp
......
/* { dg-do run } */ /* { dg-do compile } */
/* { dg-skip-if "" { *-*-* } { "-fnext-runtime" } { "" } } */ /* { 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 <objc/typedstream.h>
#include <stdio.h>
#include <stdlib.h>
int main (void) void dummy (void)
{ {
FILE *f; TypedStream *ts; TypedStream* t = objc_open_typed_stream_for_file ("dummy", 0); /* { dg-warning "deprecated" } */
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;
}
objc_write_object (t, nil); /* { dg-warning "deprecated" } */
objc_read_object (t, NULL); /* { dg-warning "deprecated" } */
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment