1 /* { dg-options "-fgnu-runtime" } */
3 #include <objc/typedstream.h>
9 FILE *f; TypedStream *ts;
10 struct T { int a, b; } x = { 1, 2 };
11 f = fopen ("foo", "w"); ts = objc_open_typed_stream (f, OBJC_WRITEONLY);
12 objc_write_type (ts, @encode(struct T), &x);
13 objc_close_typed_stream (ts); fclose (f);
14 f = fopen ("foo", "r"); ts = objc_open_typed_stream (f, OBJC_READONLY);
16 objc_read_type (ts, @encode(struct T), &y);
21 objc_close_typed_stream (ts); fclose (f);