Skip to content

Commit 2acd695

Browse files
author
Boris Kosmynin
committed
moved array tests
1 parent cd1f600 commit 2acd695

File tree

2 files changed

+50
-0
lines changed

2 files changed

+50
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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

0 commit comments

Comments
 (0)