Debian Codegraph @

check/cpp-tests/dialect_t.cpp

raw
1 /*
2 * FCML - Free Code Manipulation Library.
3 * Copyright (C) 2010-2020 Slawomir Wojtasiak
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19
20 /* Test suite initialization. */
21
22 #include "dialect_t.hpp"
23
24 #include <fcml_common.hpp>
25 #include <fcml_intel_dialect.hpp>
26
27 using namespace fcml;
28
29 class DialectExtractor: public DialectAware {
30 };
31
32 fcml_bool fcml_tf_cpp_dialect_suite_init(void) {
33 return FCML_TRUE;
34 }
35
36 fcml_bool fcml_tf_cpp_dialect_suite_cleanup(void) {
37 return FCML_TRUE;
38 }
39
40 void fcml_tf_cpp_init_intel(void) {
41 IntelDialect intel;
42 DialectExtractor extractor;
43 STF_ASSERT_PTR_NOT_NULL( extractor.extractDialect( intel ) );
44 IntelDialect *intelPTR = new IntelDialect(FCML_INTEL_DIALECT_CF_DEFAULT);
45 STF_ASSERT_PTR_NOT_NULL( extractor.extractDialect( *intelPTR ) );
46 delete intelPTR;
47 }
48
49 void fcml_tf_cpp_init_gas(void) {
50 }
51
52 fcml_stf_test_case fcml_ti_cpp_dialect[] = {
53 { "fcml_tf_cpp_init_intel", fcml_tf_cpp_init_intel },
54 { "fcml_tf_cpp_init_gas", fcml_tf_cpp_init_gas },
55 FCML_STF_NULL_TEST
56 };
57
58 fcml_stf_test_suite fcml_si_cpp_dialect = {
59 "suite-fcml-cpp-dialect", fcml_tf_cpp_dialect_suite_init, fcml_tf_cpp_dialect_suite_cleanup, fcml_ti_cpp_dialect
60 };