gcc/testsuite/gdc.test/runnable/test23387.d
raw| 1 | /* COMPILE_SEPARATELY: |
| 2 | * EXTRA_SOURCES: imports/maker.i imports/freer.i |
| 3 | */ |
| 4 | |
| 5 | // https://issues.dlang.org/show_bug.cgi?id=23387 |
| 6 | |
| 7 | /+ maker.i |
| 8 | typedef struct Foo *FooRef; |
| 9 | struct Foo { |
| 10 | int x; |
| 11 | }; |
| 12 | FooRef make_foo(void); |
| 13 | +/ |
| 14 | import imports.maker; |
| 15 | |
| 16 | |
| 17 | /+ freer.i |
| 18 | typedef struct Foo *FooRef; |
| 19 | struct Foo { |
| 20 | int x; |
| 21 | }; |
| 22 | void free_foo(FooRef foo); |
| 23 | +/ |
| 24 | import imports.freer; |
| 25 | |
| 26 | int main(){ |
| 27 | FooRef f = make_foo(); |
| 28 | free_foo(f); |
| 29 | return 0; |
| 30 | } |