File tree Expand file tree Collapse file tree 2 files changed +50
-0
lines changed
clang/tools/sotoc/test/declare_target Expand file tree Collapse file tree 2 files changed +50
-0
lines changed Original file line number Diff line number Diff line change 1+ // RUN: %sotoc-transform-compile
2+ // RUN: %run-on-host | %filecheck %s
3+ #include <stdio.h>
4+
5+ #pragma omp declare target
6+ void execfunc (void (* func )(void )){
7+ func ();
8+ }
9+
10+ void foo (){
11+ printf ("42" );
12+ fflush (0 );
13+ }
14+ #pragma omp end declare target
15+
16+ int main (void ) {
17+
18+ #pragma omp target device(0)
19+ {
20+ execfunc (& foo );
21+ }
22+ return 0 ;
23+ }
24+
25+ // CHECK: 42
Original file line number Diff line number Diff line change 1+ // RUN: %sotoc-transform-compile
2+ // RUN: %run-on-host | %filecheck %s
3+ #include <stdio.h>
4+
5+ void execfunc (void (* func )(void )){
6+ func ();
7+ }
8+
9+ #pragma omp declare target
10+ void foo (){
11+ printf ("42" );
12+ fflush (0 );
13+ }
14+ #pragma omp end declare target
15+
16+ int main (void ) {
17+
18+ #pragma omp target device(0)
19+ {
20+ execfunc (& foo );
21+ }
22+ return 0 ;
23+ }
24+
25+ // CHECK: 42
You can’t perform that action at this time.
0 commit comments