1 /* Check if array and function parameters get decayed to pointers as
4 /* { dg-options "-O2" } */
5 /* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } } */
7 #include "../objc-obj-c++-shared/TestsuiteObject.m"
11 static char global_buf[20];
13 char *strcpy_like_callee(const char *s) {
14 strcpy(global_buf, s);
18 typedef char io_string_t[512];
19 typedef char *(func_type)(const char *);
21 @interface DeviceObject: TestsuiteObject
22 - (void) func:(func_type)func stucPathInIORegistry:(io_string_t)ioRegPath;
24 @implementation DeviceObject
25 - (void) func:(func_type)func stucPathInIORegistry:(io_string_t)ioRegPath
32 io_string_t my_string;
33 DeviceObject *obj = [DeviceObject new];
35 strcpy (my_string, "Hello!");
36 strcpy (global_buf, "Good-bye!");
38 [obj func:strcpy_like_callee stucPathInIORegistry:my_string];
40 if (strcmp (global_buf, "Hello!"))