annotate gcc/testsuite/gcc.dg/plugin/plugin.exp @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children 84e7813d76e9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 # Copyright (C) 2009-2017 Free Software Foundation, Inc.
kono
parents:
diff changeset
2
kono
parents:
diff changeset
3 # This program is free software; you can redistribute it and/or modify
kono
parents:
diff changeset
4 # it under the terms of the GNU General Public License as published by
kono
parents:
diff changeset
5 # the Free Software Foundation; either version 3 of the License, or
kono
parents:
diff changeset
6 # (at your option) any later version.
kono
parents:
diff changeset
7 #
kono
parents:
diff changeset
8 # This program is distributed in the hope that it will be useful,
kono
parents:
diff changeset
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
kono
parents:
diff changeset
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
kono
parents:
diff changeset
11 # GNU General Public License for more details.
kono
parents:
diff changeset
12 #
kono
parents:
diff changeset
13 # You should have received a copy of the GNU General Public License
kono
parents:
diff changeset
14 # along with GCC; see the file COPYING3. If not see
kono
parents:
diff changeset
15 # <http://www.gnu.org/licenses/>.
kono
parents:
diff changeset
16
kono
parents:
diff changeset
17 # Test the functionality of the GCC plugin support
kono
parents:
diff changeset
18
kono
parents:
diff changeset
19 load_lib target-supports.exp
kono
parents:
diff changeset
20 load_lib gcc-dg.exp
kono
parents:
diff changeset
21
kono
parents:
diff changeset
22 global TESTING_IN_BUILD_TREE
kono
parents:
diff changeset
23 global ENABLE_PLUGIN
kono
parents:
diff changeset
24
kono
parents:
diff changeset
25 # The plugin testcases currently only work when the build tree is available.
kono
parents:
diff changeset
26 # Also check whether the host supports plugins.
kono
parents:
diff changeset
27 if { ![info exists TESTING_IN_BUILD_TREE] || ![info exists ENABLE_PLUGIN] } {
kono
parents:
diff changeset
28 return
kono
parents:
diff changeset
29 }
kono
parents:
diff changeset
30
kono
parents:
diff changeset
31 # If a testcase doesn't have special options, use these.
kono
parents:
diff changeset
32 global DEFAULT_CFLAGS
kono
parents:
diff changeset
33 if ![info exists DEFAULT_CFLAGS] then {
kono
parents:
diff changeset
34 set DEFAULT_CFLAGS " -ansi -pedantic-errors"
kono
parents:
diff changeset
35 }
kono
parents:
diff changeset
36
kono
parents:
diff changeset
37 # The procedures in plugin-support.exp need these parameters.
kono
parents:
diff changeset
38 set default_flags $DEFAULT_CFLAGS
kono
parents:
diff changeset
39
kono
parents:
diff changeset
40 if $tracelevel then {
kono
parents:
diff changeset
41 strace $tracelevel
kono
parents:
diff changeset
42 }
kono
parents:
diff changeset
43
kono
parents:
diff changeset
44 # Load support procs.
kono
parents:
diff changeset
45 load_lib plugin-support.exp
kono
parents:
diff changeset
46
kono
parents:
diff changeset
47 # These tests don't run runtest_file_p consistently if it
kono
parents:
diff changeset
48 # doesn't return the same values, so disable parallelization
kono
parents:
diff changeset
49 # of this *.exp file. The first parallel runtest to reach
kono
parents:
diff changeset
50 # this will run all the tests serially.
kono
parents:
diff changeset
51 if ![gcc_parallel_test_run_p plugin] {
kono
parents:
diff changeset
52 return
kono
parents:
diff changeset
53 }
kono
parents:
diff changeset
54 gcc_parallel_test_enable 0
kono
parents:
diff changeset
55
kono
parents:
diff changeset
56 # Specify the plugin source file and the associated test files in a list.
kono
parents:
diff changeset
57 # plugin_test_list={ {plugin1 test1 test2 ...} {plugin2 test1 ...} ... }
kono
parents:
diff changeset
58 set plugin_test_list [list \
kono
parents:
diff changeset
59 { selfassign.c self-assign-test-1.c self-assign-test-2.c } \
kono
parents:
diff changeset
60 { ggcplug.c ggcplug-test-1.c } \
kono
parents:
diff changeset
61 { one_time_plugin.c one_time-test-1.c } \
kono
parents:
diff changeset
62 { start_unit_plugin.c start_unit-test-1.c } \
kono
parents:
diff changeset
63 { finish_unit_plugin.c finish_unit-test-1.c } \
kono
parents:
diff changeset
64 { wide-int_plugin.c wide-int-test-1.c } \
kono
parents:
diff changeset
65 { diagnostic_plugin_test_show_locus.c \
kono
parents:
diff changeset
66 diagnostic-test-show-locus-bw.c \
kono
parents:
diff changeset
67 diagnostic-test-show-locus-color.c \
kono
parents:
diff changeset
68 diagnostic-test-show-locus-parseable-fixits.c \
kono
parents:
diff changeset
69 diagnostic-test-show-locus-generate-patch.c } \
kono
parents:
diff changeset
70 { diagnostic_plugin_test_tree_expression_range.c \
kono
parents:
diff changeset
71 diagnostic-test-expressions-1.c } \
kono
parents:
diff changeset
72 { diagnostic_plugin_show_trees.c \
kono
parents:
diff changeset
73 diagnostic-test-show-trees-1.c } \
kono
parents:
diff changeset
74 { diagnostic_plugin_test_string_literals.c \
kono
parents:
diff changeset
75 diagnostic-test-string-literals-1.c \
kono
parents:
diff changeset
76 diagnostic-test-string-literals-2.c \
kono
parents:
diff changeset
77 diagnostic-test-string-literals-3.c \
kono
parents:
diff changeset
78 diagnostic-test-string-literals-4.c } \
kono
parents:
diff changeset
79 { location_overflow_plugin.c \
kono
parents:
diff changeset
80 location-overflow-test-1.c \
kono
parents:
diff changeset
81 location-overflow-test-2.c } \
kono
parents:
diff changeset
82 { must_tail_call_plugin.c \
kono
parents:
diff changeset
83 must-tail-call-1.c \
kono
parents:
diff changeset
84 must-tail-call-2.c } \
kono
parents:
diff changeset
85 ]
kono
parents:
diff changeset
86
kono
parents:
diff changeset
87 foreach plugin_test $plugin_test_list {
kono
parents:
diff changeset
88 # Replace each source file with its full-path name
kono
parents:
diff changeset
89 for {set i 0} {$i < [llength $plugin_test]} {incr i} {
kono
parents:
diff changeset
90 set basename [lindex $plugin_test $i]
kono
parents:
diff changeset
91 set plugin_test [lreplace $plugin_test $i $i $srcdir/$subdir/$basename]
kono
parents:
diff changeset
92 }
kono
parents:
diff changeset
93 set plugin_src [lindex $plugin_test 0]
kono
parents:
diff changeset
94 # If we're only testing specific files and this isn't one of them, skip it.
kono
parents:
diff changeset
95 if ![runtest_file_p $runtests $plugin_src] then {
kono
parents:
diff changeset
96 continue
kono
parents:
diff changeset
97 }
kono
parents:
diff changeset
98 # Skip tail call tests on targets that do not have sibcall_epilogue.
kono
parents:
diff changeset
99 if {[regexp ".*must_tail_call_plugin.c" $plugin_src]
kono
parents:
diff changeset
100 && [istarget arm*-*-*]
kono
parents:
diff changeset
101 && [check_effective_target_arm_thumb1]} then {
kono
parents:
diff changeset
102 continue
kono
parents:
diff changeset
103 }
kono
parents:
diff changeset
104 set plugin_input_tests [lreplace $plugin_test 0 0]
kono
parents:
diff changeset
105 plugin-test-execute $plugin_src $plugin_input_tests
kono
parents:
diff changeset
106 }
kono
parents:
diff changeset
107
kono
parents:
diff changeset
108 # run the plugindir tests
kono
parents:
diff changeset
109
kono
parents:
diff changeset
110 # Initialize `dg'.
kono
parents:
diff changeset
111 dg-init
kono
parents:
diff changeset
112
kono
parents:
diff changeset
113 # Main loop.
kono
parents:
diff changeset
114 dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/plugindir*.\[cSi\]]] \
kono
parents:
diff changeset
115 "" $DEFAULT_CFLAGS
kono
parents:
diff changeset
116
kono
parents:
diff changeset
117 # All done.
kono
parents:
diff changeset
118 dg-finish
kono
parents:
diff changeset
119
kono
parents:
diff changeset
120 gcc_parallel_test_enable 1