1*1f5207b7SJohn Levon #define __user __attribute__((address_space(1))) 2*1f5207b7SJohn Levon #define NULL ((void*)0) 3*1f5207b7SJohn Levon 4*1f5207b7SJohn Levon int ret_type(void); ret_type(void)5*1f5207b7SJohn Levonvoid ret_type(void) { } /* check-should-fail */ 6*1f5207b7SJohn Levon 7*1f5207b7SJohn Levon 8*1f5207b7SJohn Levon int ret_const(void); ret_const(void)9*1f5207b7SJohn Levonint const ret_const(void) { return 0; } /* check-should-fail */ 10*1f5207b7SJohn Levon 11*1f5207b7SJohn Levon 12*1f5207b7SJohn Levon void *ret_as(void); ret_as(void)13*1f5207b7SJohn Levonvoid __user *ret_as(void) { return NULL; } /* check-should-fail */ 14*1f5207b7SJohn Levon 15*1f5207b7SJohn Levon 16*1f5207b7SJohn Levon void *ret_mod(void); ret_mod(void)17*1f5207b7SJohn Levonvoid const *ret_mod(void) { return NULL; } /* check-should-fail */ 18*1f5207b7SJohn Levon 19*1f5207b7SJohn Levon 20*1f5207b7SJohn Levon void arg_type(int a); arg_type(void * a)21*1f5207b7SJohn Levonvoid arg_type(void *a) { } /* check-should-fail */ 22*1f5207b7SJohn Levon 23*1f5207b7SJohn Levon 24*1f5207b7SJohn Levon void arg_const(int a); arg_const(const int a)25*1f5207b7SJohn Levonvoid arg_const(const int a) { } /* OK */ 26*1f5207b7SJohn Levon 27*1f5207b7SJohn Levon 28*1f5207b7SJohn Levon void arg_as(void *a); arg_as(void __user * a)29*1f5207b7SJohn Levonvoid arg_as(void __user *a) { } /* check-should-fail */ 30*1f5207b7SJohn Levon 31*1f5207b7SJohn Levon 32*1f5207b7SJohn Levon void arg_mod(void *); arg_mod(void const * a)33*1f5207b7SJohn Levonvoid arg_mod(void const *a) { } /* check-should-fail */ 34*1f5207b7SJohn Levon 35*1f5207b7SJohn Levon 36*1f5207b7SJohn Levon void arg_more_arg(int a); arg_more_arg(int a,int b)37*1f5207b7SJohn Levonvoid arg_more_arg(int a, int b) { } /* check-should-fail */ 38*1f5207b7SJohn Levon 39*1f5207b7SJohn Levon 40*1f5207b7SJohn Levon void arg_less_arg(int a, int b); arg_less_arg(int a)41*1f5207b7SJohn Levonvoid arg_less_arg(int a) { } /* check-should-fail */ 42*1f5207b7SJohn Levon 43*1f5207b7SJohn Levon 44*1f5207b7SJohn Levon void arg_vararg(int a); arg_vararg(int a,...)45*1f5207b7SJohn Levonvoid arg_vararg(int a, ...) { } /* check-should-fail */ 46*1f5207b7SJohn Levon 47*1f5207b7SJohn Levon /* 48*1f5207b7SJohn Levon * check-name: function-redecl 49*1f5207b7SJohn Levon * 50*1f5207b7SJohn Levon * check-error-start 51*1f5207b7SJohn Levon function-redecl.c:5:6: error: symbol 'ret_type' redeclared with different type (originally declared at function-redecl.c:4) - different base types 52*1f5207b7SJohn Levon function-redecl.c:9:11: error: symbol 'ret_const' redeclared with different type (originally declared at function-redecl.c:8) - different modifiers 53*1f5207b7SJohn Levon function-redecl.c:13:13: error: symbol 'ret_as' redeclared with different type (originally declared at function-redecl.c:12) - different address spaces 54*1f5207b7SJohn Levon function-redecl.c:17:12: error: symbol 'ret_mod' redeclared with different type (originally declared at function-redecl.c:16) - different modifiers 55*1f5207b7SJohn Levon function-redecl.c:21:6: error: symbol 'arg_type' redeclared with different type (originally declared at function-redecl.c:20) - incompatible argument 1 (different base types) 56*1f5207b7SJohn Levon function-redecl.c:29:6: error: symbol 'arg_as' redeclared with different type (originally declared at function-redecl.c:28) - incompatible argument 1 (different address spaces) 57*1f5207b7SJohn Levon function-redecl.c:33:6: error: symbol 'arg_mod' redeclared with different type (originally declared at function-redecl.c:32) - incompatible argument 1 (different modifiers) 58*1f5207b7SJohn Levon function-redecl.c:37:6: error: symbol 'arg_more_arg' redeclared with different type (originally declared at function-redecl.c:36) - different argument counts 59*1f5207b7SJohn Levon function-redecl.c:41:6: error: symbol 'arg_less_arg' redeclared with different type (originally declared at function-redecl.c:40) - different argument counts 60*1f5207b7SJohn Levon function-redecl.c:45:6: error: symbol 'arg_vararg' redeclared with different type (originally declared at function-redecl.c:44) - incompatible variadic arguments 61*1f5207b7SJohn Levon * check-error-end 62*1f5207b7SJohn Levon */ 63