aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/i386/math-torture/math-torture.exp
blob: 2b1d63de17add99dbc9a9078ecf9a2fad6217ea9 (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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc.
#
# This file is part of GCC.
#
# GCC is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
# GCC is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GCC; see the file COPYING3.  If not see
# <http://www.gnu.org/licenses/>.

# This harness is for tests that should be run at all optimisation levels.

load_lib target-supports.exp

# Exit immediately if this isn't a x86 target.
if { ![istarget i?86*-*-*] && ![istarget x86_64-*-*] } then {
  return
}

set MATH_TORTURE_OPTIONS [list \
        { -O0 } \
        { -O0 -mfpmath=387 } \
        { -O0 -mfpmath=387 -ffast-math } \
        { -O2 } \
        { -O2 -mfpmath=387 } \
        { -O2 -mfpmath=387 -ffast-math } \
]

if { [check_effective_target_sse] } {
    lappend MATH_TORTURE_OPTIONS \
        { -O0 -msse -mno-sse2 -mfpmath=sse } \
        { -O0 -msse -mno-sse2 -mfpmath=sse,387 } \
        { -O0 -msse -mno-sse2 -mfpmath=sse -ffast-math } \
        { -O0 -msse -mno-sse2 -mfpmath=sse,387 -ffast-math } \
        { -O2 -msse -mno-sse2 -mfpmath=sse } \
        { -O2 -msse -mno-sse2 -mfpmath=sse,387 } \
        { -O2 -msse -mno-sse2 -mfpmath=sse -ffast-math } \
        { -O2 -msse -mno-sse2 -mfpmath=sse,387 -ffast-math } \
}

if { [check_effective_target_sse2] } {
    lappend MATH_TORTURE_OPTIONS \
        { -O0 -msse -msse2 -mfpmath=sse } \
        { -O0 -msse -msse2 -mfpmath=sse,387 } \
        { -O0 -msse -msse2 -mfpmath=sse -ffast-math } \
        { -O0 -msse -msse2 -mfpmath=sse,387 -ffast-math } \
        { -O2 -msse -msse2 -mfpmath=sse } \
        { -O2 -msse -msse2 -mfpmath=sse,387 } \
        { -O2 -msse -msse2 -mfpmath=sse -ffast-math } \
        { -O2 -msse -msse2 -mfpmath=sse,387 -ffast-math } \
}

load_lib gcc-dg.exp
load_lib torture-options.exp

torture-init
set-torture-options $MATH_TORTURE_OPTIONS {{}} $LTO_TORTURE_OPTIONS

dg-init
gcc-dg-runtest [lsort [glob $srcdir/$subdir/*.c]] ""
torture-finish
dg-finish