]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/lib/target-utils.exp
Update copyright years.
[thirdparty/gcc.git] / gcc / testsuite / lib / target-utils.exp
1 # Copyright (C) 2014-2024 Free Software Foundation, Inc.
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 #
18 # ${tool}_check_unsupported_p -- Check the compiler(/assembler/linker) output
19 # for text indicating that the testcase should be marked as "unsupported"
20 #
21 # When dealing with a large number of tests, it's difficult to weed out the
22 # ones that are too big for a particular cpu (eg: 16 bit with a small amount
23 # of memory). There are various ways to deal with this. Here's one.
24 # Fortunately, all of the cases where this is likely to happen will be using
25 # gld so we can tell what the error text will look like.
26 #
27
28 load_lib target-supports.exp
29
30 proc ${tool}_check_unsupported_p { output } {
31 if [regexp "(^|\n)\[^\n\]*: region \[^\n\]* is full" $output] {
32 return "memory full"
33 }
34 if { [regexp "(^|\n)\[^\n\]*: relocation truncated to fit" $output]
35 && [check_effective_target_tiny] } {
36 return "memory full"
37 }
38 if { [regexp "(^|\n)\[^\n\]*: region \[^\n\]* overflowed" $output]
39 && [check_effective_target_tiny] } {
40 return "memory full"
41 }
42
43 if { [string match "*error: function pointers not supported*" $output]
44 && ![check_effective_target_function_pointers] } {
45 return "function pointers not supported"
46 }
47 if { [string match "*error: large return values not supported*" $output]
48 && ![check_effective_target_large_return_values] } {
49 return "large return values not supported"
50 }
51 return ""
52 }