aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/gomp/declare-variant-duplicates.f90
blob: 16dc0858ff962173c539357dcee97b0f6f02cba0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
! Check that errors are detected if duplicates appear in name-list
! properties.

integer function f1 (x)
  integer, intent(in) :: x
  f1 = x + 1
end function
integer function f2 (x)
  integer, intent(in) :: x
  f2 = x + 2
end function
integer function f3 (x)
  integer, intent(in) :: x
  f3 = x + 3
end function
integer function f4 (x)
  integer, intent(in) :: x
  f4 = x + 4
end function

integer function f (x)
  integer, intent(in) :: x

  !$omp declare variant (f1) match (device={kind(cpu,gpu,"cpu")})  ! { dg-error "trait-property .cpu. specified more than once" }
  !$omp declare variant (f2) match (device={isa(sse4,"avx",avx)})  ! { dg-error "trait-property .avx. specified more than once" }
  !$omp declare variant (f3) match (device={arch(x86_64,i386,aarch64,"i386")})  ! { dg-error "trait-property .i386. specified more than once" }
  !$omp declare variant (f4) match (implementation={vendor(llvm,gnu,"arm",gnu)})  ! { dg-error "trait-property .gnu. specified more than once" }

  f = x
end function