1 /* Check if array and function parameters get decayed to pointers as
4 /* { dg-options "-O2" } */
5 /* { dg-additional-sources "../objc-obj-c++-shared/Object1.m" } */
6 /* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } } */
8 #include "../objc-obj-c++-shared/Object1.h"
12 static char global_buf[20];
14 char *strcpy_like_callee(const char *s) {
15 strcpy(global_buf, s);
19 typedef char io_string_t[512];
20 typedef char *(func_type)(const char *);
22 @interface DeviceObject: Object
23 - (void) func:(func_type)func stucPathInIORegistry:(io_string_t)ioRegPath;
25 @implementation DeviceObject
26 - (void) func:(func_type)func stucPathInIORegistry:(io_string_t)ioRegPath
33 io_string_t my_string;
34 DeviceObject *obj = [DeviceObject new];
36 strcpy (my_string, "Hello!");
37 strcpy (global_buf, "Good-bye!");
39 [obj func:strcpy_like_callee stucPathInIORegistry:my_string];
41 if (strcmp (global_buf, "Hello!"))