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" } */
8 #include <objc/Object.h>
11 @class MyTarget, MySet;
15 @interface MyTargetBuildContext : Object
18 unsigned _cacheInvalDisableCount;
19 BOOL _cacheInvalidationNeeded;
20 unsigned short _isCreatingDependencies:1;
21 unsigned short _isCreatingHeadermap:1;
22 unsigned short _haveAddedIdleTimeInvoc:1;
23 BOOL _hasSetUpBuildSettings;
25 - (id)initWithTarget:(MyTarget *)target;
29 @interface MyTargetBuildContext (PrivateMethods)
30 + (MySet *)_headerFileExtensions;
33 @interface MyCountedSet: Object {
38 - (id)sortedArrayUsingFunction:(int (*)(id, id, void *))comparator with:(int)value;
41 @implementation MyCountedSet
47 - (id)sortedArrayUsingFunction:(int (*)(id, id, void *))comparator with:(int)value {
48 if(value == comparator(self, self, self))
54 @implementation MyTargetBuildContext : Object
55 - (id)initWithTarget:(MyTarget *)target
65 static int _MyCompareObjectsByDecreasingSetCount (id object1, id object2, MyCountedSet * countedSet)
68 return countedSet->cardinality;
70 + (MySet *)_headerFileExtensions
72 MySet * _headerFileExtensions = 0;
73 return _headerFileExtensions;
75 - (void)_recomputeHeadermap
77 MyCountedSet *set = [MyCountedSet new];
78 int (*functionPointer)(id, id, void *) = (int (*)(id, id, void *))_MyCompareObjectsByDecreasingSetCount;
79 id result = [set sortedArrayUsingFunction:functionPointer with:5];
84 MyTargetBuildContext *ctx = [MyTargetBuildContext new];
85 [ctx _recomputeHeadermap];
86 if (global_value != 5)