]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - gold/testsuite/icf_test_pr21066.sh
Update year range in copyright notice of binutils files
[thirdparty/binutils-gdb.git] / gold / testsuite / icf_test_pr21066.sh
1 #!/bin/sh
2
3 # icf_test_pr21066.sh -- regression test for ICF tracking exception handling
4 # metadata differences
5
6 # Copyright (C) 2009-2021 Free Software Foundation, Inc.
7 # Written by Joshua Oreman <oremanj@hudson-trading.com>, based on icf_test.sh
8
9 # This file is part of gold.
10
11 # This program is free software; you can redistribute it and/or modify
12 # it under the terms of the GNU General Public License as published by
13 # the Free Software Foundation; either version 3 of the License, or
14 # (at your option) any later version.
15
16 # This program is distributed in the hope that it will be useful,
17 # but WITHOUT ANY WARRANTY; without even the implied warranty of
18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 # GNU General Public License for more details.
20
21 # You should have received a copy of the GNU General Public License
22 # along with this program; if not, write to the Free Software
23 # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
24 # MA 02110-1301, USA.
25
26 set -e
27
28 check()
29 {
30 awk "
31 BEGIN { discard = 0; }
32 /^Discarded input/ { discard = 1; }
33 /^Memory map/ { discard = 0; }
34 /.*\\.text\\..*capture_exception_of_type.*($2|$3).*/ {
35 act[discard] = act[discard] \" \" \$0;
36 }
37 END {
38 # printf \"kept\" act[0] \"\\nfolded\" act[1] \"\\n\";
39 if (length(act[0]) != 0 && length(act[1]) != 0)
40 {
41 printf \"Identical Code Folding improperly folded functions\\n\"
42 printf \"with same code but different .gcc_except_table\\n\"
43 exit 1;
44 }
45 }" $1
46 }
47
48 check icf_test_pr21066.map "first_exception" "second_exception"