3 # missing_key_func.sh -- a test case for printing error messages when
4 # a class is missing its key function.
6 # Copyright (C) 2013-2020 Free Software Foundation, Inc.
7 # Written by Cary Coutant <ccoutant@google.com>
9 # This file is part of gold.
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.
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.
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,
26 # This file goes with debug_msg.cc, a C++ source file constructed to
27 # have undefined references. We compile that file with debug
28 # information and then try to link it, and make sure the proper errors
29 # are displayed. The errors will be found in debug_msg.err.
33 if ! grep -q "$2" "$1"
35 echo "Did not find expected error in $1:"
38 echo "Actual error output below:"
48 echo "Found unexpected error in $1:"
51 echo "Actual error output below:"
57 check missing_key_func.err
"error: undefined reference to 'vtable for C'"
58 check missing_key_func.err
"class is missing its key function"