diff options
Diffstat (limited to 'gcc/testsuite/obj-c++.dg/keywords-2.mm')
-rw-r--r-- | gcc/testsuite/obj-c++.dg/keywords-2.mm | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/gcc/testsuite/obj-c++.dg/keywords-2.mm b/gcc/testsuite/obj-c++.dg/keywords-2.mm new file mode 100644 index 000000000..c81cb4d0c --- /dev/null +++ b/gcc/testsuite/obj-c++.dg/keywords-2.mm @@ -0,0 +1,24 @@ +/* Test that 'encode', 'end', 'compatibility_alias', 'defs', + 'protocol', 'selector', finally', 'synchronized', 'interface', + 'implementation' are not keywords if not after a '@'. +*/ +/* { dg-do compile } */ + +int encode (int end) +{ + int compatibility_alias = end * 2; + int defs = compatibility_alias * 2; + int protocol = defs * 2; + int selector = protocol * 2; + int finally = selector * 2; + int synchronized = finally * 2; + int interface = synchronized * 2; + int implementation = interface * 2; + + return implementation; +} + +int main (void) +{ + return encode (0); +} |