summaryrefslogtreecommitdiff
path: root/gcc/testsuite/objc.dg/keywords-2.m
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/objc.dg/keywords-2.m')
-rw-r--r--gcc/testsuite/objc.dg/keywords-2.m24
1 files changed, 24 insertions, 0 deletions
diff --git a/gcc/testsuite/objc.dg/keywords-2.m b/gcc/testsuite/objc.dg/keywords-2.m
new file mode 100644
index 000000000..c81cb4d0c
--- /dev/null
+++ b/gcc/testsuite/objc.dg/keywords-2.m
@@ -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);
+}