summaryrefslogtreecommitdiff
path: root/gcc/testsuite/obj-c++.dg/fix-and-continue-2.mm
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/obj-c++.dg/fix-and-continue-2.mm')
-rw-r--r--gcc/testsuite/obj-c++.dg/fix-and-continue-2.mm24
1 files changed, 24 insertions, 0 deletions
diff --git a/gcc/testsuite/obj-c++.dg/fix-and-continue-2.mm b/gcc/testsuite/obj-c++.dg/fix-and-continue-2.mm
new file mode 100644
index 000000000..fdfbcbd0c
--- /dev/null
+++ b/gcc/testsuite/obj-c++.dg/fix-and-continue-2.mm
@@ -0,0 +1,24 @@
+/* Static variables, even if local, require indirect access through a stub
+ if -mfix-and-continue is enabled. */
+
+/* Author: Ziemowit Laski <zlaski@apple.com> */
+
+/* { dg-do assemble { target *-*-darwin* } } */
+/* { dg-options "-mfix-and-continue" } */
+
+#include "../objc-obj-c++-shared/Object1.h"
+
+@interface Foo: Object
++ (Object *)indexableFileTypes;
+@end
+
+@implementation Foo
++ (Object *)indexableFileTypes
+{
+ static Object *fileTypes = 0;
+ if(!fileTypes) {
+ fileTypes = [Object new];
+ }
+ return fileTypes;
+}
+@end