struct f0_s0 { unsigned a; };
struct f0_s1 : public f0_s0 { void *b; };
void f0(f0_s1 a0) { }
struct f1_s0 { unsigned a; unsigned b; float c; };
struct f1_s1 : public f1_s0 { float d;};
void f1(f1_s1 a0) { }
struct f2_s0 { unsigned a; unsigned b; float c; };
struct f2_s1 : public f2_s0 { char d;};
void f2(f2_s1 a0) { }
struct s3_0 {};
struct s3_1 { struct s3_0 a; long b; };
void f3(struct s3_1 x) {}
struct s4 {};
typedef int s4::* s4_mdp;
typedef int (s4::*s4_mfp)();
s4_mdp f4_0(s4_mdp a) { return a; }
s4_mfp f4_1(s4_mfp a) { return a; }
struct struct_with_mdp { char *a; s4_mdp b; };
void f_struct_with_mdp(struct_with_mdp a) { (void)a; }
struct struct_with_mfp_0 { char a; s4_mfp b; };
void f_struct_with_mfp_0(struct_with_mfp_0 a) { (void)a; }
struct struct_with_mfp_1 { void *a; s4_mfp b; };
void f_struct_with_mfp_1(struct_with_mfp_1 a) { (void)a; }
namespace PR7523 {
struct StringRef {
char *a;
};
void AddKeyword(StringRef, int x);
void foo() {
AddKeyword(StringRef(), 4);
}
}
namespace PR7742 { struct s2 {
float a[2];
};
struct c2 : public s2 {};
c2 foo(c2 *P) {
return c2();
}
}
namespace PR5179 {
struct B {};
struct B1 : B {
int* pa;
};
struct B2 : B {
B1 b1;
};
const void *bar(B2 b2) {
return b2.b1.pa;
}
}
namespace test5 {
struct Xbase { };
struct Empty { };
struct Y;
struct X : public Xbase {
Empty empty;
Y f();
};
struct Y : public X {
Empty empty;
};
X getX();
int takeY(const Y&, int y);
void g() {
takeY(getX().f(), 42);
}
}
namespace test6 {
struct outer {
int x;
struct epsilon_matcher {} e;
int f;
};
int test(outer x) {
return x.x + x.f;
}
}
namespace test7 {
struct StringRef {char* ptr; long len; };
class A { public: ~A(); };
A x(A, A, long, long, StringRef) { return A(); }
A y(A, long double, long, long, StringRef) { return A(); }
struct StringDouble {char * ptr; double d;};
A z(A, A, A, A, A, StringDouble) { return A(); }
A zz(A, A, A, A, StringDouble) { return A(); }
}
namespace test8 {
class A {
char big[17];
};
class B : public A {};
void foo(B b);
void bar() {
B b;
foo(b);
}
}
namespace test9 {
struct S { void *data[3]; };
struct T { void *data[2]; };
void foo(S*, T*) {}
S a(int, int, int, int, T, void*) {
return S();
}
S* b(S* sret, int, int, int, int, T, void*) {
return sret;
}
S c(int, int, int, T, void*) {
return S();
}
S* d(S* sret, int, int, int, T, void*) {
return sret;
}
}
namespace test10 {
#pragma pack(1)
struct BasePacked {
char one;
short two;
};
#pragma pack()
struct DerivedPacked : public BasePacked {
int three;
};
int FuncForDerivedPacked(DerivedPacked d) {
return d.three;
}
}
namespace test11 {
union U {
float f1;
char __attribute__((__vector_size__(1))) f2;
};
int f(union U u) { return u.f2[1]; }
}