libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / selftest-logical-location.cc
blob8017672afa7e37243168e183931363f5a1316a96
1 /* Concrete subclass of logical_location for use in selftests.
2 Copyright (C) 2024 Free Software Foundation, Inc.
3 Contributed by David Malcolm <dmalcolm@redhat.com>.
5 This file is part of GCC.
7 GCC is free software; you can redistribute it and/or modify it under
8 the terms of the GNU General Public License as published by the Free
9 Software Foundation; either version 3, or (at your option) any later
10 version.
12 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
13 WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 for more details.
17 You should have received a copy of the GNU General Public License
18 along with GCC; see the file COPYING3. If not see
19 <http://www.gnu.org/licenses/>. */
21 #include "config.h"
22 #include "system.h"
23 #include "coretypes.h"
24 #include "selftest-logical-location.h"
26 #if CHECKING_P
28 namespace selftest {
30 /* class test_logical_location : public logical_location. */
32 test_logical_location::test_logical_location (enum logical_location_kind kind,
33 const char *name)
34 : m_kind (kind),
35 m_name (name)
39 const char *
40 test_logical_location::get_short_name () const
42 return m_name;
45 const char *
46 test_logical_location::get_name_with_scope () const
48 return m_name;
51 const char *
52 test_logical_location::get_internal_name () const
54 return m_name;
57 enum logical_location_kind
58 test_logical_location::get_kind () const
60 return m_kind;
63 label_text
64 test_logical_location::get_name_for_path_output () const
66 return label_text::borrow (m_name);
69 } // namespace selftest
71 #endif /* #if CHECKING_P */