repo.or.cz
/
official-gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
PR testsuite/85483: Move aarch64/sve/vcond_1.c test to g++.dg/other/
[official-gcc.git]
/
libgomp
/
testsuite
/
libgomp.c
/
switch-conversion.c
blob
835f54e17acb4befe8d0e37cc9235a5e7987b711
1
/* PR tree-optimization/85063 */
2
/* { dg-additional-options "-ftree-switch-conversion" } */
3
4
#include <stdlib.h>
5
6
#pragma omp declare target
7
static int
__attribute__
((
noinline
))
foo
(
int
n
)
8
{
9
switch
(
n
&
3
)
10
{
11
case
0
:
return
4
;
12
case
1
:
return
3
;
13
case
2
:
return
2
;
14
default
:
15
return
1
;
16
}
17
}
18
#pragma omp end declare target
19
20
int
21
main
(
void
)
22
{
23
int
n
[
1
];
24
25
n
[
0
] =
4
;
26
27
#pragma omp target
28
{
29
n
[
0
] =
foo
(
n
[
0
]);
30
}
31
32
if
(
n
[
0
] !=
4
)
33
abort
();
34
35
return
0
;
36
}