diff options
Diffstat (limited to 'gcc/testsuite')
-rw-r--r-- | gcc/testsuite/ChangeLog | 12 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/simd-builtins-1.f90 | 19 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/simd-builtins-1.h | 4 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/simd-builtins-2.f90 | 20 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/simd-builtins-3.f90 | 1 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/simd-builtins-3.h | 8 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/simd-builtins-4.f | 1 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/simd-builtins-4.h | 8 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/simd-builtins-5.f | 9 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/simd-builtins-6.f90 | 24 |
10 files changed, 106 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 9e1f6d0..e6bc1f8 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,15 @@ +2018-11-27 Martin Liska <mliska@suse.cz> + + * gfortran.dg/simd-builtins-1.f90: New test. + * gfortran.dg/simd-builtins-1.h: New test. + * gfortran.dg/simd-builtins-2.f90: New test. + * gfortran.dg/simd-builtins-3.f90: New test. + * gfortran.dg/simd-builtins-3.h: New test. + * gfortran.dg/simd-builtins-4.f: New test. + * gfortran.dg/simd-builtins-4.h: New test. + * gfortran.dg/simd-builtins-5.f: New test. + * gfortran.dg/simd-builtins-6.f90: New test. + 2018-11-27 Jozef Lawrynowicz <jozef.l@mittosystems.com> * lib/target-supports.exp diff --git a/gcc/testsuite/gfortran.dg/simd-builtins-1.f90 b/gcc/testsuite/gfortran.dg/simd-builtins-1.f90 new file mode 100644 index 0000000..e5ee380 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/simd-builtins-1.f90 @@ -0,0 +1,19 @@ +! { dg-do compile { target { i?86-*-linux* x86_64-*-linux* } } } +! { dg-additional-options "-msse2 -nostdinc -Ofast -fpre-include=simd-builtins-1.h -fdump-tree-optimized" } + +program test_overloaded_intrinsic + real(4) :: x4(3200), y4(3200) + real(8) :: x8(3200), y8(3200) + + ! this should be using simd clone + y4 = sin(x4) + print *, y4 + + ! this should not be using simd clone + y4 = sin(x8) + print *, y8 +end + +! { dg-final { scan-tree-dump "sinf.simdclone" "optimized" } } */ +! { dg-final { scan-tree-dump "__builtin_sin" "optimized" } } */ +! { dg-final { scan-assembler "call.*_ZGVbN4v_sinf" } } diff --git a/gcc/testsuite/gfortran.dg/simd-builtins-1.h b/gcc/testsuite/gfortran.dg/simd-builtins-1.h new file mode 100644 index 0000000..88d555c --- /dev/null +++ b/gcc/testsuite/gfortran.dg/simd-builtins-1.h @@ -0,0 +1,4 @@ +!GCC$ builtin (sin) attributes simd (inbranch) +!GCC$ builtin (sinf) attributes simd (notinbranch) +!GCC$ builtin (cosf) attributes simd +!GCC$ builtin (cosf) attributes simd (notinbranch) diff --git a/gcc/testsuite/gfortran.dg/simd-builtins-2.f90 b/gcc/testsuite/gfortran.dg/simd-builtins-2.f90 new file mode 100644 index 0000000..f0e6bc1 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/simd-builtins-2.f90 @@ -0,0 +1,20 @@ +! { dg-do compile { target { i?86-*-linux* x86_64-*-linux* } } } +! { dg-additional-options "-msse2 -nostdinc -Ofast -fdump-tree-optimized" } + +program test_overloaded_intrinsic + real(4) :: x4(3200), y4(3200) + real(8) :: x8(3200), y8(3200) + + ! this should be using simd clone + y4 = sin(x4) + print *, y4 + + ! this should not be using simd clone + y4 = sin(x8) + print *, y8 +end + +! { dg-final { scan-tree-dump "__builtin_sinf" "optimized" } } */ +! { dg-final { scan-tree-dump "__builtin_sin" "optimized" } } */ +! { dg-final { scan-tree-dump-not "simdclone" "optimized" } } */ +! { dg-final { scan-assembler-not "call.*_ZGVbN4v_sinf" } } diff --git a/gcc/testsuite/gfortran.dg/simd-builtins-3.f90 b/gcc/testsuite/gfortran.dg/simd-builtins-3.f90 new file mode 100644 index 0000000..949209b --- /dev/null +++ b/gcc/testsuite/gfortran.dg/simd-builtins-3.f90 @@ -0,0 +1 @@ +! { dg-additional-options "-nostdinc -fpre-include=simd-builtins-3.h" } diff --git a/gcc/testsuite/gfortran.dg/simd-builtins-3.h b/gcc/testsuite/gfortran.dg/simd-builtins-3.h new file mode 100644 index 0000000..9707ef0 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/simd-builtins-3.h @@ -0,0 +1,8 @@ +!GCC$ builtin (sin) attributes simd (inbranch) +!GCC$ builtin ( sin) attributes simd (inbranch) +!GCC$ builtin (sin ) attributes simd (inbranch) +!GCC$ builtin (sin) attributes simd ( inbranch) +!GCC$ builtin (sin) attributes simd (inbranch ) +!GCC$ builtin(sin ) attributes simd ( inbranch ) +!GCC$ builtin ( sin ) attributes simd ( inbranch ) +!GCC$ builtin ( sin ) attributes simd diff --git a/gcc/testsuite/gfortran.dg/simd-builtins-4.f b/gcc/testsuite/gfortran.dg/simd-builtins-4.f new file mode 100644 index 0000000..48947b6 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/simd-builtins-4.f @@ -0,0 +1 @@ +! { dg-additional-options "-nostdinc -fpre-include=simd-builtins-4.h" } diff --git a/gcc/testsuite/gfortran.dg/simd-builtins-4.h b/gcc/testsuite/gfortran.dg/simd-builtins-4.h new file mode 100644 index 0000000..9707ef0 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/simd-builtins-4.h @@ -0,0 +1,8 @@ +!GCC$ builtin (sin) attributes simd (inbranch) +!GCC$ builtin ( sin) attributes simd (inbranch) +!GCC$ builtin (sin ) attributes simd (inbranch) +!GCC$ builtin (sin) attributes simd ( inbranch) +!GCC$ builtin (sin) attributes simd (inbranch ) +!GCC$ builtin(sin ) attributes simd ( inbranch ) +!GCC$ builtin ( sin ) attributes simd ( inbranch ) +!GCC$ builtin ( sin ) attributes simd diff --git a/gcc/testsuite/gfortran.dg/simd-builtins-5.f b/gcc/testsuite/gfortran.dg/simd-builtins-5.f new file mode 100644 index 0000000..55330a8 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/simd-builtins-5.f @@ -0,0 +1,9 @@ +! { dg-do compile } + +!GCC$ buil tin (s in) attributes simd (inbranch) +!GCC$ builtin (sinf) at tributes simd (notinbranch) +!GCC$ builtin (cosf) att r i bu tes s imd +!GCC$ buil ti n ( cosf) attrib utes simd (noti nbranch) + + PROGRAM Z + END diff --git a/gcc/testsuite/gfortran.dg/simd-builtins-6.f90 b/gcc/testsuite/gfortran.dg/simd-builtins-6.f90 new file mode 100644 index 0000000..5ff9921 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/simd-builtins-6.f90 @@ -0,0 +1,24 @@ +! { dg-do compile { target { i?86-*-linux* x86_64-*-linux* } } } +! { dg-additional-options "-msse2 -nostdinc -Ofast -fdump-tree-optimized" } + +!GCC$ builtin (sin) attributes simd (inbranch) +!GCC$ builtin (sinf) attributes simd (notinbranch) +!GCC$ builtin (cosf) attributes simd +!GCC$ builtin (cosf) attributes simd (notinbranch) + +program test_overloaded_intrinsic + real(4) :: x4(3200), y4(3200) + real(8) :: x8(3200), y8(3200) + + ! this should be using simd clone + y4 = sin(x4) + print *, y4 + + ! this should not be using simd clone + y4 = sin(x8) + print *, y8 +end + +! { dg-final { scan-tree-dump "sinf.simdclone" "optimized" } } */ +! { dg-final { scan-tree-dump "__builtin_sin" "optimized" } } */ +! { dg-final { scan-assembler "call.*_ZGVbN4v_sinf" } } |