1! { dg-do compile }
2! { dg-additional-options "-cpp -fdump-tree-gimple" }
3! { dg-additional-options "-mno-sse3" { target { i?86-*-* x86_64-*-* } } }
4
5program main
6  implicit none
7contains
8  subroutine f01 ()
9  end subroutine
10  subroutine f02 ()
11    !$omp declare variant (f01) match (device={isa("avx512f",avx512bw)})
12  end subroutine
13  subroutine f05 ()
14  end subroutine
15  subroutine f06 ()
16    !$omp declare variant (f05) match (device={kind(gpu)})
17  end subroutine
18  subroutine f07 ()
19  end subroutine
20  subroutine f08 ()
21    !$omp declare variant (f07) match (device={kind("cpu")})
22  end subroutine
23  subroutine f09 ()
24  end subroutine
25  subroutine f10 ()
26    !$omp declare variant (f09) match (device={isa(sm_35)})
27  end subroutine
28  subroutine f11 ()
29  end subroutine
30  subroutine f12 ()
31    !$omp declare variant (f11) match (device={arch(nvptx)})
32  end subroutine
33  subroutine f13 ()
34  end subroutine
35  subroutine f14 ()
36    !$omp declare variant (f13) match (device={arch("i386"),isa(sse4)})
37  end subroutine
38  subroutine f17 ()
39  end subroutine
40  subroutine f18 ()
41    !$omp declare variant (f17) match (device={kind("any","fpga")})
42  end subroutine
43
44  subroutine test1 ()
45    integer ::  i;
46    call f02 ()	! { dg-final { scan-tree-dump-times "f02 \\\(\\\);" 1 "gimple" } }
47    call f14 ()	! { dg-final { scan-tree-dump-times "f14 \\\(\\\);" 1 "gimple" } }
48    call f18 ()	! { dg-final { scan-tree-dump-times "f18 \\\(\\\);" 1 "gimple" } }
49  end subroutine
50
51  subroutine test3 ()
52    call f06 ()	! { dg-final { scan-tree-dump-times "f06 \\\(\\\);" 1 "gimple" { target { ! { nvptx*-*-* amdgcn*-*-* } } } } }
53    call f08 ()	! { dg-final { scan-tree-dump-times "f07 \\\(\\\);" 1 "gimple" { target { ! { nvptx*-*-* amdgcn*-*-* } } } } }
54    call f10 ()	! { dg-final { scan-tree-dump-times "f10 \\\(\\\);" 1 "gimple" { target { ! { nvptx*-*-* amdgcn*-*-* } } } } }
55    call f12 ()	! { dg-final { scan-tree-dump-times "f12 \\\(\\\);" 1 "gimple" { target { ! { nvptx*-*-* } } } } }
56		! { dg-final { scan-tree-dump-times "f11 \\\(\\\);" 1 "gimple" { target { nvptx*-*-* } } } }
57  end subroutine
58end program
59