3 // BUILD: $CC main.m -o $BUILD_DIR/_dyld_get_objc_selector-chained.exe -lobjc -Wl,-fixup_chains
5 // RUN: ./_dyld_get_objc_selector-chained.exe
7 #include <mach-o/dyld_priv.h>
9 #import <Foundation/Foundation.h>
11 #include "test_support.h"
13 @interface DyldClass : NSObject
16 @implementation DyldClass
17 -(void) dyldClassFoo {
20 +(void) dyldClassFoo {
25 @interface DyldMainClass : NSObject
28 @implementation DyldMainClass
29 -(void) dyldMainClassFoo {
32 -(void) dyldMainClassFoo2 {
37 extern id objc_getClass(const char *name);
39 int main(int argc, const char* argv[], const char* envp[], const char* apple[]) {
41 const char* sel = _dyld_get_objc_selector("dyldClassFoo");
43 if ((SEL)sel != @selector(dyldClassFoo)) {
44 FAIL("dyldClassFoo is wrong");
49 sel = _dyld_get_objc_selector("dyldMainClassFoo");
51 if ((SEL)sel != @selector(dyldMainClassFoo)) {
52 FAIL("dyldMainClassFoo is wrong");
57 sel = _dyld_get_objc_selector("dyldMainClassFoo2");
59 if ((SEL)sel != @selector(dyldMainClassFoo2)) {
60 FAIL("dyldMainClassFoo2 is wrong");