1 # Copyright
(C
) 2009-2017 Free Software Foundation
, Inc.
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.
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.
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
/>.
17 # Test the functionality of the GCC plugin support
19 load_lib target
-supports.exp
20 load_lib
obj-c
++-dg.exp
22 global TESTING_IN_BUILD_TREE
25 # The plugin testcases currently only work when the build tree is available.
26 # Also check whether the host supports plugins.
27 if { ![info exists TESTING_IN_BUILD_TREE
] ||
![info exists ENABLE_PLUGIN
] } {
31 #
If a testcase doesn
't have special options, use these.
33 if ![info exists DEFAULT_CFLAGS] then {
34 set DEFAULT_CFLAGS " -ansi -pedantic-errors"
37 # The procedures in plugin-support.exp need these parameters.
38 set default_flags $DEFAULT_CFLAGS
45 load_lib plugin-support.exp
47 # These tests don't run runtest_file_p consistently
if it
48 # doesn
't return the same values, so disable parallelization
49 # of this *.exp file. The first parallel runtest to reach
50 # this will run all the tests serially.
51 if ![gcc_parallel_test_run_p plugin] {
54 gcc_parallel_test_enable 0
56 # Specify the plugin source file and the associated test files in a list.
57 # plugin_test_list={ {plugin1 test1 test2 ...} {plugin2 test1 ...} ... }
58 set plugin_test_list [list \
59 { ../../gcc.dg/plugin/diagnostic_plugin_test_tree_expression_range.c \
60 diagnostic-test-expressions-1.mm } \
63 foreach plugin_test $plugin_test_list {
64 # Replace each source file with its full-path name
65 for {set i 0} {$i < [llength $plugin_test]} {incr i} {
66 set basename [lindex $plugin_test $i]
67 set plugin_test [lreplace $plugin_test $i $i $srcdir/$subdir/$basename]
69 set plugin_src [lindex $plugin_test 0]
70 # If we're only testing specific files and this isn
't one of them, skip it.
71 if ![runtest_file_p $runtests $plugin_src] then {
74 set plugin_input_tests [lreplace $plugin_test 0 0]
75 plugin-test-execute $plugin_src $plugin_input_tests
78 # run the plugindir tests
84 dg
-runtest
[lsort
[glob
-nocomplain $srcdir
/$subdir
/plugindir
*.mm
]] \
90 gcc_parallel_test_enable
1