xref: /minix3/external/bsd/llvm/dist/clang/test/CodeGen/overloadable.c (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -emit-llvm %s -o - | grep _Z1fPA10_1X
2*f4a2713aSLionel Sambuc int __attribute__((overloadable)) f(int x) { return x; }
3*f4a2713aSLionel Sambuc float __attribute__((overloadable)) f(float x) { return x; }
4*f4a2713aSLionel Sambuc double __attribute__((overloadable)) f(double x) { return x; }
5*f4a2713aSLionel Sambuc double _Complex __attribute__((overloadable)) f(double _Complex x) { return x; }
6*f4a2713aSLionel Sambuc typedef short v4hi __attribute__ ((__vector_size__ (8)));
7*f4a2713aSLionel Sambuc v4hi __attribute__((overloadable)) f(v4hi x) { return x; }
8*f4a2713aSLionel Sambuc 
9*f4a2713aSLionel Sambuc struct X { };
10*f4a2713aSLionel Sambuc void  __attribute__((overloadable)) f(struct X (*ptr)[10]) { }
11*f4a2713aSLionel Sambuc 
12*f4a2713aSLionel Sambuc void __attribute__((overloadable)) f(int x, int y, ...) { }
13*f4a2713aSLionel Sambuc 
14*f4a2713aSLionel Sambuc int main() {
15*f4a2713aSLionel Sambuc   int iv = 17;
16*f4a2713aSLionel Sambuc   float fv = 3.0f;
17*f4a2713aSLionel Sambuc   double dv = 4.0;
18*f4a2713aSLionel Sambuc   double _Complex cdv;
19*f4a2713aSLionel Sambuc   v4hi vv;
20*f4a2713aSLionel Sambuc 
21*f4a2713aSLionel Sambuc   iv = f(iv);
22*f4a2713aSLionel Sambuc   fv = f(fv);
23*f4a2713aSLionel Sambuc   dv = f(dv);
24*f4a2713aSLionel Sambuc   cdv = f(cdv);
25*f4a2713aSLionel Sambuc   vv = f(vv);
26*f4a2713aSLionel Sambuc }
27