| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110 | 
							- /* GCC-StarPU
 
-    Copyright (C) 2011 Institut National de Recherche en Informatique et Automatique
 
-    GCC-StarPU is free software: you can redistribute it and/or modify
 
-    it under the terms of the GNU General Public License as published by
 
-    the Free Software Foundation, either version 3 of the License, or
 
-    (at your option) any later version.
 
-    GCC-StarPU is distributed in the hope that it will be useful,
 
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
 
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
-    GNU General Public License for more details.
 
-    You should have received a copy of the GNU General Public License
 
-    along with GCC-StarPU.  If not, see <http://www.gnu.org/licenses/>.  */
 
- /* Test error handling for the `task' and `task_implementation' attributes.  */
 
- extern void my_external_task (int foo, char *bar) __attribute__ ((task));
 
- static void my_task (int foo, char *bar) __attribute__ ((task));
 
- static void my_task_cpu (int foo, float *bar)    /* (error "type differs") */
 
-   __attribute__ ((task_implementation ("cpu", my_task)));
 
- static void my_task_opencl (long foo, char *bar) /* (error "type differs") */
 
-   __attribute__ ((task_implementation ("opencl", my_task)));
 
- static void my_task_nowhere (int foo, char *bar) /* (warning "unsupported target") */
 
-   __attribute__ ((task_implementation ("does-not-exist", my_task)));
 
- static void my_task_not_quite (int foo, char *bar) /* (error "lacks the 'task' attribute") */
 
-   __attribute__ ((task_implementation ("cpu", my_task_nowhere)));
 
- static int foo /* (error "only applies to function") */
 
-   __attribute__ ((task_implementation ("cpu", my_task)));
 
- static int bar /* (error "only applies to function") */
 
-   __attribute__ ((task, unused));
 
- static int not_a_task __attribute__ ((unused));
 
- static void my_task_almost (int foo, char *bar)    /* (error "not a function") */
 
-   __attribute__ ((task_implementation ("cpu", not_a_task)));
 
- static void my_task_wrong_task_arg (int foo, char *bar)   /* (error "not a function") */
 
-   __attribute__ ((task_implementation ("cpu", 123)));
 
- static void my_task_wrong_target_arg (int foo, char *bar) /* (error "string constant expected") */
 
-   __attribute__ ((task_implementation (123, my_task)));
 
- static void my_task_with_a_body (int foo, char *bar)
 
-   __attribute__ ((task, unused));
 
- extern int my_task_not_void (int foo) /* (error "return type") */
 
-   __attribute__ ((task));
 
- void my_task_that_invokes_task (int x, char *y)
 
-   __attribute__ ((task));
 
- void my_task_that_invokes_task_cpu (int x, char *y)
 
-   __attribute__ ((task_implementation ("cpu", my_task_that_invokes_task)));
 
- static void
 
- my_task_cpu (int foo, float *bar)
 
- {
 
- }
 
- static void
 
- my_task_opencl (long foo, char *bar)
 
- {
 
- }
 
- static void
 
- my_task_nowhere (int foo, char *bar)
 
- {
 
- }
 
- static void
 
- my_task_not_quite (int foo, char *bar)
 
- {
 
- }
 
- static void
 
- my_task_almost (int foo, char *bar)
 
- {
 
- }
 
- static void
 
- my_task_wrong_task_arg (int foo, char *bar)
 
- {
 
- }
 
- static void
 
- my_task_wrong_target_arg (int foo, char *bar)
 
- {
 
- }
 
- static void
 
- my_task_with_a_body (int foo, char *bar)  /* (error "must not have a body") */
 
- {
 
- }
 
- void
 
- my_task_that_invokes_task_cpu (int x, char *y)
 
- {
 
-   my_external_task (x, y); /* (error "cannot be invoked from task implementation") */
 
- }
 
 
  |