1*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -fsyntax-only -verify %s
2*f4a2713aSLionel Sambuc // RUN: cp %s %t
3*f4a2713aSLionel Sambuc // RUN: not %clang_cc1 -fsyntax-only -fixit -x c %t
4*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -fsyntax-only -pedantic -x c %t
5*f4a2713aSLionel Sambuc
ip(int * aPtr)6*f4a2713aSLionel Sambuc void ip(int *aPtr) {} // expected-note{{passing argument to parameter 'aPtr' here}}
i(int a)7*f4a2713aSLionel Sambuc void i(int a) {} // expected-note{{passing argument to parameter 'a' here}}
ii(int a)8*f4a2713aSLionel Sambuc void ii(int a) {} // expected-note{{passing argument to parameter 'a' here}}
fp(float * aPtr)9*f4a2713aSLionel Sambuc void fp(float *aPtr) {} // expected-note{{passing argument to parameter 'aPtr' here}}
f(float a)10*f4a2713aSLionel Sambuc void f(float a) {} // expected-note{{passing argument to parameter 'a' here}}
11*f4a2713aSLionel Sambuc
f2(int * aPtr,int a,float * bPtr,char c)12*f4a2713aSLionel Sambuc void f2(int *aPtr, int a, float *bPtr, char c) {
13*f4a2713aSLionel Sambuc float fl = 0;
14*f4a2713aSLionel Sambuc ip(a); // expected-warning{{incompatible integer to pointer conversion passing 'int' to parameter of type 'int *'; take the address with &}}
15*f4a2713aSLionel Sambuc i(aPtr); // expected-warning{{incompatible pointer to integer conversion passing 'int *' to parameter of type 'int'; dereference with *}}
16*f4a2713aSLionel Sambuc ii(&a); // expected-warning{{incompatible pointer to integer conversion passing 'int *' to parameter of type 'int'; remove &}}
17*f4a2713aSLionel Sambuc fp(*bPtr); // expected-error{{passing 'float' to parameter of incompatible type 'float *'; remove *}}
18*f4a2713aSLionel Sambuc f(bPtr); // expected-error{{passing 'float *' to parameter of incompatible type 'float'; dereference with *}}
19*f4a2713aSLionel Sambuc a = aPtr; // expected-warning{{incompatible pointer to integer conversion assigning to 'int' from 'int *'; dereference with *}}
20*f4a2713aSLionel Sambuc fl = bPtr + a; // expected-error{{assigning to 'float' from incompatible type 'float *'; dereference with *}}
21*f4a2713aSLionel Sambuc bPtr = bPtr[a]; // expected-error{{assigning to 'float *' from incompatible type 'float'; take the address with &}}
22*f4a2713aSLionel Sambuc }
23