1! { dg-options "-O3 -fdump-tree-lversion-details" } 2 3! Check that versioning is applied to a gather-like reduction operation. 4 5function f(x, index, n) 6 integer :: n 7 real :: x(:) 8 integer :: index(n) 9 f = sum(x(index(:))) 10end function f 11 12! { dg-final { scan-tree-dump-times {want to version containing loop} 1 "lversion" } } 13! { dg-final { scan-tree-dump-times {versioned this loop} 1 "lversion" } } 14