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