1 /* Test a little inefficiency that was fixed in libobjc when dealing
2 with selectors (PR libobjc/45953). */
5 /* { dg-skip-if "" { *-*-* } { "-fnext-runtime" } { "" } } */
7 /* To get the modern GNU Objective-C Runtime API, you include
9 #include <objc/runtime.h>
12 /* Test that registering a new selector, with the same name but a
13 different type than the previous one, does not change the original
14 name string. It is actually fine to change it (there is no
15 guarantee that it won't change), except for runtime performance /
16 memory consumption, since changing it means that the runtime is
17 doing an unneeded objc_malloc()/strcpy(), which is inefficient. */
26 /* These method type strings may well be invalid. Please don't use
27 them as examples. They are irrelevant for this test; any string
29 selector_1 = sel_registerTypedName ("method", "v@:");
30 name_1 = sel_getName (selector_1);
32 selector_2 = sel_registerTypedName ("method", "i@:");
33 name_2 = sel_getName (selector_1);