Debian Codegraph @

gcc/testsuite/gfortran.dg/gomp/declare-variant-duplicates.f90

raw
1 ! Check that errors are detected if duplicates appear in name-list
2 ! properties.
3
4 integer function f1 (x)
5 integer, intent(in) :: x
6 f1 = x + 1
7 end function
8 integer function f2 (x)
9 integer, intent(in) :: x
10 f2 = x + 2
11 end function
12 integer function f3 (x)
13 integer, intent(in) :: x
14 f3 = x + 3
15 end function
16 integer function f4 (x)
17 integer, intent(in) :: x
18 f4 = x + 4
19 end function
20
21 integer function f (x)
22 integer, intent(in) :: x
23
24 !$omp declare variant (f1) match (device={kind(cpu,gpu,"cpu")}) ! { dg-error "trait-property .cpu. specified more than once" }
25 !$omp declare variant (f2) match (device={isa(sse4,"avx",avx)}) ! { dg-error "trait-property .avx. specified more than once" }
26 !$omp declare variant (f3) match (device={arch(x86_64,i386,aarch64,"i386")}) ! { dg-error "trait-property .i386. specified more than once" }
27 !$omp declare variant (f4) match (implementation={vendor(llvm,gnu,"arm",gnu)}) ! { dg-error "trait-property .gnu. specified more than once" }
28
29 f = x
30 end function