int var __attribute__((overloadable));
int *f(int) __attribute__((overloadable)); float *f(float); int *f(int); double *f(double) __attribute__((overloadable));
void test_f(int iv, float fv, double dv) {
int *ip = f(iv);
float *fp = f(fv);
double *dp = f(dv);
}
int *accept_funcptr(int (*)()) __attribute__((overloadable)); float *accept_funcptr(int (*)(int, double)) __attribute__((overloadable));
void test_funcptr(int (*f1)(int, double),
int (*f2)(int, float)) {
float *fp = accept_funcptr(f1);
accept_funcptr(f2); }
struct X { int x; float y; };
struct Y { int x; float y; };
int* accept_struct(struct X x) __attribute__((__overloadable__));
float* accept_struct(struct Y y) __attribute__((overloadable));
void test_struct(struct X x, struct Y y) {
int *ip = accept_struct(x);
float *fp = accept_struct(y);
}
double *f(int) __attribute__((overloadable));
double promote(float) __attribute__((__overloadable__)); double promote(double) __attribute__((__overloadable__)); long double promote(long double) __attribute__((__overloadable__));
void promote(...) __attribute__((__overloadable__, __unavailable__));
void test_promote(short* sp) {
promote(1.0);
promote(sp); }
typedef double Double;
typedef Double DoubleVec __attribute__((vector_size(16)));
typedef int Int;
typedef Int IntVec __attribute__((vector_size(16)));
double magnitude(DoubleVec) __attribute__((__overloadable__));
double magnitude(IntVec) __attribute__((__overloadable__));
double test_p6600(DoubleVec d) {
return magnitude(d) * magnitude(d);
}
extern int __attribute__((overloadable)) f0(); typedef int f1_type();
f1_type __attribute__((overloadable)) f1;
void test() {
f0();
f1();
}