1! { dg-do compile { target { i?86-*-linux* x86_64-*-linux* aarch64*-*-linux* } } }
2! { dg-additional-options "-nostdinc -Ofast -fdump-tree-optimized" }
3! { dg-additional-options "-msse2 -mno-avx" { target i?86-*-linux* x86_64-*-linux* } }
4
5!GCC$ builtin (sin) attributes simd (inbranch)
6!GCC$ builtin (sinf) attributes simd (notinbranch)
7!GCC$ builtin (cosf) attributes simd
8!GCC$ builtin (cosf) attributes simd (notinbranch)
9
10program test_overloaded_intrinsic
11  real(4) :: x4(3200), y4(3200)
12  real(8) :: x8(3200), y8(3200)
13
14  ! this should be using simd clone
15  y4 = sin(x4)
16  print *, y4
17
18  ! this should not be using simd clone
19  y4 = sin(x8)
20  print *, y8
21end
22
23! { dg-final { scan-tree-dump "sinf.simdclone" "optimized" } } */
24! { dg-final { scan-tree-dump "__builtin_sin" "optimized" } } */
25! { dg-final { scan-assembler "call.*_ZGVbN4v_sinf" { target i?86-*-linux* x86_64-*-* } } }
26! { dg-final { scan-assembler "bl.*_ZGVnN4v_sinf" { target aarch64*-*-* } } }
27