1 /* Fix and continue should not interfere with computation of
2 local (static) function addresses. */
3 /* Author: Ziemowit Laski <zlaski@apple.com> */
5 /* { dg-do run { target *-*-darwin* } } */
6 /* { dg-options "-mfix-and-continue" } */
7 /* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } } */
9 #include "../objc-obj-c++-shared/Object1.h"
12 @class MyTarget, MySet;
16 @interface MyTargetBuildContext : Object
19 unsigned _cacheInvalDisableCount;
20 BOOL _cacheInvalidationNeeded;
21 unsigned short _isCreatingDependencies:1;
22 unsigned short _isCreatingHeadermap:1;
23 unsigned short _haveAddedIdleTimeInvoc:1;
24 BOOL _hasSetUpBuildSettings;
26 - (id)initWithTarget:(MyTarget *)target;
30 @interface MyTargetBuildContext (PrivateMethods)
31 + (MySet *)_headerFileExtensions;
34 @interface MyCountedSet: Object {
39 - (id)sortedArrayUsingFunction:(int (*)(id, id, void *))comparator with:(int)value;
42 @implementation MyCountedSet
48 - (id)sortedArrayUsingFunction:(int (*)(id, id, void *))comparator with:(int)value {
49 if(value == comparator(self, self, self))
55 @implementation MyTargetBuildContext : Object
56 - (id)initWithTarget:(MyTarget *)target
66 static int _MyCompareObjectsByDecreasingSetCount (id object1, id object2, MyCountedSet * countedSet)
69 return countedSet->cardinality;
71 + (MySet *)_headerFileExtensions
73 MySet * _headerFileExtensions = 0;
74 return _headerFileExtensions;
76 - (void)_recomputeHeadermap
78 MyCountedSet *set = [MyCountedSet new];
79 int (*functionPointer)(id, id, void *) = (int (*)(id, id, void *))_MyCompareObjectsByDecreasingSetCount;
80 id result = [set sortedArrayUsingFunction:functionPointer with:5];
85 MyTargetBuildContext *ctx = [MyTargetBuildContext new];
86 [ctx _recomputeHeadermap];
87 if (global_value != 5)
93 #include "../objc-obj-c++-shared/Object1-implementation.h"