]>
Commit | Line | Data |
---|---|---|
8d9254fc | 1 | # Copyright (C) 2014-2020 Free Software Foundation, Inc. |
2f46a9cd CL |
2 | |
3 | # This program is free software; you can redistribute it and/or modify | |
4 | # it under the terms of the GNU General Public License as published by | |
5 | # the Free Software Foundation; either version 3 of the License, or | |
6 | # (at your option) any later version. | |
7 | # | |
8 | # This program is distributed in the hope that it will be useful, | |
9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
11 | # GNU General Public License for more details. | |
12 | # | |
13 | # You should have received a copy of the GNU General Public License | |
14 | # along with GCC; see the file COPYING3. If not see | |
15 | # <http://www.gnu.org/licenses/>. | |
16 | ||
17 | # GCC testsuite that uses the `dg.exp' driver. | |
18 | ||
19 | # Exit immediately if this isn't an ARM or AArch64 target. | |
20 | if {![istarget arm*-*-*] | |
21 | && ![istarget aarch64*-*-*]} then { | |
22 | return | |
23 | } | |
24 | ||
25 | # Load support procs. | |
26 | load_lib gcc-dg.exp | |
27 | ||
28 | # Initialize `dg'. | |
29 | load_lib c-torture.exp | |
2f46a9cd CL |
30 | |
31 | dg-init | |
32 | ||
83844a7d SL |
33 | # The default action for a test is 'run'. Save current default. |
34 | global dg-do-what-default | |
35 | set save-dg-do-what-default ${dg-do-what-default} | |
83844a7d SL |
36 | |
37 | # For ARM, make sure that we have a target compatible with NEON, and do | |
38 | # not attempt to run execution tests if the hardware doesn't support it. | |
39 | if {[istarget arm*-*-*]} then { | |
40 | if {![check_effective_target_arm_neon_ok]} then { | |
41 | return | |
42 | } | |
43 | if {![is-effective-target arm_neon_hw]} then { | |
44 | set dg-do-what-default compile | |
676d1384 SL |
45 | } else { |
46 | set dg-do-what-default run | |
83844a7d | 47 | } |
676d1384 SL |
48 | } else { |
49 | set dg-do-what-default run | |
d80b40be CL |
50 | } |
51 | ||
8c629c03 | 52 | torture-init |
2f46a9cd CL |
53 | set-torture-options $C_TORTURE_OPTIONS {{}} $LTO_TORTURE_OPTIONS |
54 | ||
1fa754dc | 55 | # Make sure Neon flags are provided, if necessary. Use fp16 if we can. |
cab9e1df MW |
56 | # Use fp16 arithmetic operations if the hardware supports it. |
57 | if {[check_effective_target_arm_v8_2a_fp16_neon_hw]} then { | |
58 | set additional_flags [add_options_for_arm_v8_2a_fp16_neon ""] | |
59 | } elseif {[check_effective_target_arm_neon_fp16_ok]} then { | |
1fa754dc AL |
60 | set additional_flags [add_options_for_arm_neon_fp16 ""] |
61 | } else { | |
62 | set additional_flags [add_options_for_arm_neon ""] | |
63 | } | |
2f46a9cd CL |
64 | |
65 | # Main loop. | |
f4fa7bb4 AL |
66 | gcc-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.c]] \ |
67 | "" ${additional_flags} | |
2f46a9cd CL |
68 | |
69 | # All done. | |
83844a7d | 70 | set dg-do-what-default ${save-dg-do-what-default} |
8c629c03 | 71 | torture-finish |
2f46a9cd | 72 | dg-finish |