gcc/testsuite/objc.dg/keywords-1.m
raw| 1 | /* Test that 'in', 'out', 'inout', 'bycopy', 'byref', 'oneway' |
| 2 | are not keywords outside of a "protocol qualifier" context. |
| 3 | */ |
| 4 | /* { dg-do compile } */ |
| 5 | |
| 6 | typedef int in; |
| 7 | |
| 8 | in out (in inout) |
| 9 | { |
| 10 | int byref = inout * 2; |
| 11 | |
| 12 | return byref + inout; |
| 13 | } |
| 14 | |
| 15 | @class byref; |
| 16 | |
| 17 | @interface inout |
| 18 | @end |
| 19 | |
| 20 | @protocol oneway; |
| 21 | |
| 22 | int main (void) |
| 23 | { |
| 24 | in bycopy = (in)(out (0)); |
| 25 | |
| 26 | return (in)bycopy; |
| 27 | } |