xref: /aosp_15_r20/build/bazel/rules/cc/cfi_transition_test.bzl (revision 7594170e27e0732bc44b93d1440d87a54b6ffe7c)
1*7594170eSAndroid Build Coastguard Worker# Copyright (C) 2023 The Android Open Source Project
2*7594170eSAndroid Build Coastguard Worker#
3*7594170eSAndroid Build Coastguard Worker# Licensed under the Apache License, Version 2.0 (the "License");
4*7594170eSAndroid Build Coastguard Worker# you may not use this file except in compliance with the License.
5*7594170eSAndroid Build Coastguard Worker# You may obtain a copy of the License at
6*7594170eSAndroid Build Coastguard Worker#
7*7594170eSAndroid Build Coastguard Worker#     http://www.apache.org/licenses/LICENSE-2.0
8*7594170eSAndroid Build Coastguard Worker#
9*7594170eSAndroid Build Coastguard Worker# Unless required by applicable law or agreed to in writing, software
10*7594170eSAndroid Build Coastguard Worker# distributed under the License is distributed on an "AS IS" BASIS,
11*7594170eSAndroid Build Coastguard Worker# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12*7594170eSAndroid Build Coastguard Worker# See the License for the specific language governing permissions and
13*7594170eSAndroid Build Coastguard Worker# limitations under the License.
14*7594170eSAndroid Build Coastguard Worker
15*7594170eSAndroid Build Coastguard Workerload("@bazel_skylib//lib:unittest.bzl", "analysistest")
16*7594170eSAndroid Build Coastguard Workerload(
17*7594170eSAndroid Build Coastguard Worker    "@soong_injection//cc_toolchain:sanitizer_constants.bzl",
18*7594170eSAndroid Build Coastguard Worker    _generated_sanitizer_constants = "constants",
19*7594170eSAndroid Build Coastguard Worker)
20*7594170eSAndroid Build Coastguard Workerload(
21*7594170eSAndroid Build Coastguard Worker    "//build/bazel/rules/cc/testing:transitions.bzl",
22*7594170eSAndroid Build Coastguard Worker    "compile_action_argv_aspect_generator",
23*7594170eSAndroid Build Coastguard Worker    "transition_deps_test_attrs",
24*7594170eSAndroid Build Coastguard Worker    "transition_deps_test_impl",
25*7594170eSAndroid Build Coastguard Worker)
26*7594170eSAndroid Build Coastguard Workerload(":cc_binary.bzl", "cc_binary")
27*7594170eSAndroid Build Coastguard Workerload(":cc_constants.bzl", "transition_constants")
28*7594170eSAndroid Build Coastguard Workerload(":cc_library_shared.bzl", "cc_library_shared")
29*7594170eSAndroid Build Coastguard Workerload(":cc_library_static.bzl", "cc_library_static")
30*7594170eSAndroid Build Coastguard Worker
31*7594170eSAndroid Build Coastguard Worker_compile_action_argv_aspect = compile_action_argv_aspect_generator({
32*7594170eSAndroid Build Coastguard Worker    "_cc_library_combiner": ["deps", "roots", "includes"],
33*7594170eSAndroid Build Coastguard Worker    "_cc_includes": ["deps"],
34*7594170eSAndroid Build Coastguard Worker    "_cc_library_shared_proxy": ["deps"],
35*7594170eSAndroid Build Coastguard Worker    "cc_binary": ["deps"],
36*7594170eSAndroid Build Coastguard Worker    "stripped_binary": ["src", "unstripped"],
37*7594170eSAndroid Build Coastguard Worker})
38*7594170eSAndroid Build Coastguard Worker
39*7594170eSAndroid Build Coastguard Worker_cfi_deps_test = analysistest.make(
40*7594170eSAndroid Build Coastguard Worker    transition_deps_test_impl,
41*7594170eSAndroid Build Coastguard Worker    attrs = transition_deps_test_attrs,
42*7594170eSAndroid Build Coastguard Worker    extra_target_under_test_aspects = [_compile_action_argv_aspect],
43*7594170eSAndroid Build Coastguard Worker)
44*7594170eSAndroid Build Coastguard Worker
45*7594170eSAndroid Build Coastguard Workercfi_feature = "android_cfi"
46*7594170eSAndroid Build Coastguard Workerstatic_cpp_suffix = "_cpp"
47*7594170eSAndroid Build Coastguard Workershared_or_binary_cpp_suffix = "__internal_root_cpp"
48*7594170eSAndroid Build Coastguard Workerbinary_suffix = "__internal_root"
49*7594170eSAndroid Build Coastguard Worker
50*7594170eSAndroid Build Coastguard Workerdef _test_cfi_propagates_to_static_deps():
51*7594170eSAndroid Build Coastguard Worker    name = "cfi_propagates_to_static_deps"
52*7594170eSAndroid Build Coastguard Worker    static_dep_name = name + "_static_dep"
53*7594170eSAndroid Build Coastguard Worker    static_dep_of_static_dep_name = static_dep_name + "_of_static_dep"
54*7594170eSAndroid Build Coastguard Worker    test_name = name + "_test"
55*7594170eSAndroid Build Coastguard Worker
56*7594170eSAndroid Build Coastguard Worker    cc_library_shared(
57*7594170eSAndroid Build Coastguard Worker        name = name,
58*7594170eSAndroid Build Coastguard Worker        srcs = ["foo.cpp"],
59*7594170eSAndroid Build Coastguard Worker        deps = [static_dep_name],
60*7594170eSAndroid Build Coastguard Worker        features = [cfi_feature],
61*7594170eSAndroid Build Coastguard Worker        tags = ["manual"],
62*7594170eSAndroid Build Coastguard Worker    )
63*7594170eSAndroid Build Coastguard Worker
64*7594170eSAndroid Build Coastguard Worker    cc_library_static(
65*7594170eSAndroid Build Coastguard Worker        name = static_dep_name,
66*7594170eSAndroid Build Coastguard Worker        srcs = ["bar.cpp"],
67*7594170eSAndroid Build Coastguard Worker        deps = [static_dep_of_static_dep_name],
68*7594170eSAndroid Build Coastguard Worker        tags = ["manual"],
69*7594170eSAndroid Build Coastguard Worker    )
70*7594170eSAndroid Build Coastguard Worker
71*7594170eSAndroid Build Coastguard Worker    cc_library_static(
72*7594170eSAndroid Build Coastguard Worker        name = static_dep_of_static_dep_name,
73*7594170eSAndroid Build Coastguard Worker        srcs = ["baz.cpp"],
74*7594170eSAndroid Build Coastguard Worker        tags = ["manual"],
75*7594170eSAndroid Build Coastguard Worker    )
76*7594170eSAndroid Build Coastguard Worker
77*7594170eSAndroid Build Coastguard Worker    _cfi_deps_test(
78*7594170eSAndroid Build Coastguard Worker        name = test_name,
79*7594170eSAndroid Build Coastguard Worker        target_under_test = name,
80*7594170eSAndroid Build Coastguard Worker        flags = [_generated_sanitizer_constants.CfiCrossDsoFlag],
81*7594170eSAndroid Build Coastguard Worker        targets_with_flag = [
82*7594170eSAndroid Build Coastguard Worker            name + shared_or_binary_cpp_suffix,
83*7594170eSAndroid Build Coastguard Worker            static_dep_name + static_cpp_suffix,
84*7594170eSAndroid Build Coastguard Worker            static_dep_of_static_dep_name + static_cpp_suffix,
85*7594170eSAndroid Build Coastguard Worker        ],
86*7594170eSAndroid Build Coastguard Worker        targets_without_flag = [],
87*7594170eSAndroid Build Coastguard Worker    )
88*7594170eSAndroid Build Coastguard Worker
89*7594170eSAndroid Build Coastguard Worker    return test_name
90*7594170eSAndroid Build Coastguard Worker
91*7594170eSAndroid Build Coastguard Workerdef _test_cfi_does_not_propagate_to_shared_deps():
92*7594170eSAndroid Build Coastguard Worker    name = "cfi_does_not_propagate_to_shared_deps"
93*7594170eSAndroid Build Coastguard Worker    shared_dep_name = name + "shared_dep"
94*7594170eSAndroid Build Coastguard Worker    test_name = name + "_test"
95*7594170eSAndroid Build Coastguard Worker
96*7594170eSAndroid Build Coastguard Worker    cc_library_shared(
97*7594170eSAndroid Build Coastguard Worker        name = name,
98*7594170eSAndroid Build Coastguard Worker        srcs = ["foo.cpp"],
99*7594170eSAndroid Build Coastguard Worker        deps = [shared_dep_name],
100*7594170eSAndroid Build Coastguard Worker        features = [cfi_feature],
101*7594170eSAndroid Build Coastguard Worker        tags = ["manual"],
102*7594170eSAndroid Build Coastguard Worker    )
103*7594170eSAndroid Build Coastguard Worker
104*7594170eSAndroid Build Coastguard Worker    cc_library_shared(
105*7594170eSAndroid Build Coastguard Worker        name = shared_dep_name,
106*7594170eSAndroid Build Coastguard Worker        srcs = ["bar.cpp"],
107*7594170eSAndroid Build Coastguard Worker        tags = ["manual"],
108*7594170eSAndroid Build Coastguard Worker    )
109*7594170eSAndroid Build Coastguard Worker
110*7594170eSAndroid Build Coastguard Worker    _cfi_deps_test(
111*7594170eSAndroid Build Coastguard Worker        name = test_name,
112*7594170eSAndroid Build Coastguard Worker        target_under_test = name,
113*7594170eSAndroid Build Coastguard Worker        flags = [_generated_sanitizer_constants.CfiCrossDsoFlag],
114*7594170eSAndroid Build Coastguard Worker        targets_with_flag = [name + shared_or_binary_cpp_suffix],
115*7594170eSAndroid Build Coastguard Worker        targets_without_flag = [shared_dep_name + shared_or_binary_cpp_suffix],
116*7594170eSAndroid Build Coastguard Worker    )
117*7594170eSAndroid Build Coastguard Worker
118*7594170eSAndroid Build Coastguard Worker    return test_name
119*7594170eSAndroid Build Coastguard Worker
120*7594170eSAndroid Build Coastguard Workerdef _test_cfi_disabled_propagates_to_static_deps():
121*7594170eSAndroid Build Coastguard Worker    name = "cfi_disabled_propagates_to_static_deps"
122*7594170eSAndroid Build Coastguard Worker    static_dep_name = name + "_static_dep"
123*7594170eSAndroid Build Coastguard Worker    test_name = name + "_test"
124*7594170eSAndroid Build Coastguard Worker
125*7594170eSAndroid Build Coastguard Worker    cc_library_shared(
126*7594170eSAndroid Build Coastguard Worker        name = name,
127*7594170eSAndroid Build Coastguard Worker        srcs = ["foo.cpp"],
128*7594170eSAndroid Build Coastguard Worker        deps = [static_dep_name],
129*7594170eSAndroid Build Coastguard Worker        tags = ["manual"],
130*7594170eSAndroid Build Coastguard Worker    )
131*7594170eSAndroid Build Coastguard Worker
132*7594170eSAndroid Build Coastguard Worker    cc_library_static(
133*7594170eSAndroid Build Coastguard Worker        name = static_dep_name,
134*7594170eSAndroid Build Coastguard Worker        srcs = ["bar.cpp"],
135*7594170eSAndroid Build Coastguard Worker        features = ["android_cfi"],
136*7594170eSAndroid Build Coastguard Worker        tags = ["manual"],
137*7594170eSAndroid Build Coastguard Worker    )
138*7594170eSAndroid Build Coastguard Worker
139*7594170eSAndroid Build Coastguard Worker    _cfi_deps_test(
140*7594170eSAndroid Build Coastguard Worker        name = test_name,
141*7594170eSAndroid Build Coastguard Worker        target_under_test = name,
142*7594170eSAndroid Build Coastguard Worker        flags = [_generated_sanitizer_constants.CfiCrossDsoFlag],
143*7594170eSAndroid Build Coastguard Worker        targets_with_flag = [],
144*7594170eSAndroid Build Coastguard Worker        targets_without_flag = [
145*7594170eSAndroid Build Coastguard Worker            name + shared_or_binary_cpp_suffix,
146*7594170eSAndroid Build Coastguard Worker            static_dep_name + static_cpp_suffix,
147*7594170eSAndroid Build Coastguard Worker        ],
148*7594170eSAndroid Build Coastguard Worker    )
149*7594170eSAndroid Build Coastguard Worker
150*7594170eSAndroid Build Coastguard Worker    return test_name
151*7594170eSAndroid Build Coastguard Worker
152*7594170eSAndroid Build Coastguard Workerdef _test_cfi_binary_propagates_to_static_deps():
153*7594170eSAndroid Build Coastguard Worker    name = "cfi_binary_propagates_to_static_deps"
154*7594170eSAndroid Build Coastguard Worker    static_dep_name = name + "_static_dep"
155*7594170eSAndroid Build Coastguard Worker    test_name = name + "_test"
156*7594170eSAndroid Build Coastguard Worker
157*7594170eSAndroid Build Coastguard Worker    cc_binary(
158*7594170eSAndroid Build Coastguard Worker        name = name,
159*7594170eSAndroid Build Coastguard Worker        srcs = ["foo.cpp"],
160*7594170eSAndroid Build Coastguard Worker        deps = [static_dep_name],
161*7594170eSAndroid Build Coastguard Worker        features = [cfi_feature],
162*7594170eSAndroid Build Coastguard Worker        tags = ["manual"],
163*7594170eSAndroid Build Coastguard Worker    )
164*7594170eSAndroid Build Coastguard Worker
165*7594170eSAndroid Build Coastguard Worker    cc_library_static(
166*7594170eSAndroid Build Coastguard Worker        name = static_dep_name,
167*7594170eSAndroid Build Coastguard Worker        srcs = ["bar.cpp"],
168*7594170eSAndroid Build Coastguard Worker        tags = ["manual"],
169*7594170eSAndroid Build Coastguard Worker    )
170*7594170eSAndroid Build Coastguard Worker
171*7594170eSAndroid Build Coastguard Worker    _cfi_deps_test(
172*7594170eSAndroid Build Coastguard Worker        name = test_name,
173*7594170eSAndroid Build Coastguard Worker        target_under_test = name,
174*7594170eSAndroid Build Coastguard Worker        flags = [_generated_sanitizer_constants.CfiCrossDsoFlag],
175*7594170eSAndroid Build Coastguard Worker        targets_with_flag = [
176*7594170eSAndroid Build Coastguard Worker            name + shared_or_binary_cpp_suffix,
177*7594170eSAndroid Build Coastguard Worker            static_dep_name + static_cpp_suffix,
178*7594170eSAndroid Build Coastguard Worker        ],
179*7594170eSAndroid Build Coastguard Worker        targets_without_flag = [],
180*7594170eSAndroid Build Coastguard Worker    )
181*7594170eSAndroid Build Coastguard Worker
182*7594170eSAndroid Build Coastguard Worker    return test_name
183*7594170eSAndroid Build Coastguard Worker
184*7594170eSAndroid Build Coastguard Worker_cfi_deps_cfi_include_paths_test = analysistest.make(
185*7594170eSAndroid Build Coastguard Worker    transition_deps_test_impl,
186*7594170eSAndroid Build Coastguard Worker    attrs = transition_deps_test_attrs,
187*7594170eSAndroid Build Coastguard Worker    extra_target_under_test_aspects = [_compile_action_argv_aspect],
188*7594170eSAndroid Build Coastguard Worker    config_settings = {
189*7594170eSAndroid Build Coastguard Worker        transition_constants.cli_platforms_key: [
190*7594170eSAndroid Build Coastguard Worker            "@//build/bazel/tests/products:aosp_x86_for_testing_cfi_include_path",
191*7594170eSAndroid Build Coastguard Worker        ],
192*7594170eSAndroid Build Coastguard Worker    },
193*7594170eSAndroid Build Coastguard Worker)
194*7594170eSAndroid Build Coastguard Worker
195*7594170eSAndroid Build Coastguard Workerdef _test_cfi_include_paths_enables_cfi_for_device():
196*7594170eSAndroid Build Coastguard Worker    name = "cfi_include_paths_enables_cfi_for_device"
197*7594170eSAndroid Build Coastguard Worker    test_name = name + "_test"
198*7594170eSAndroid Build Coastguard Worker
199*7594170eSAndroid Build Coastguard Worker    cc_library_shared(
200*7594170eSAndroid Build Coastguard Worker        name = name,
201*7594170eSAndroid Build Coastguard Worker        srcs = ["foo.cpp"],
202*7594170eSAndroid Build Coastguard Worker        tags = ["manual"],
203*7594170eSAndroid Build Coastguard Worker    )
204*7594170eSAndroid Build Coastguard Worker
205*7594170eSAndroid Build Coastguard Worker    _cfi_deps_cfi_include_paths_test(
206*7594170eSAndroid Build Coastguard Worker        name = test_name,
207*7594170eSAndroid Build Coastguard Worker        target_under_test = name,
208*7594170eSAndroid Build Coastguard Worker        flags = [_generated_sanitizer_constants.CfiCrossDsoFlag],
209*7594170eSAndroid Build Coastguard Worker        targets_with_flag = [name + shared_or_binary_cpp_suffix],
210*7594170eSAndroid Build Coastguard Worker        targets_without_flag = [],
211*7594170eSAndroid Build Coastguard Worker    )
212*7594170eSAndroid Build Coastguard Worker
213*7594170eSAndroid Build Coastguard Worker    return test_name
214*7594170eSAndroid Build Coastguard Worker
215*7594170eSAndroid Build Coastguard Worker_cfi_deps_cfi_includes_paths_host_no_cfi_test = analysistest.make(
216*7594170eSAndroid Build Coastguard Worker    transition_deps_test_impl,
217*7594170eSAndroid Build Coastguard Worker    attrs = transition_deps_test_attrs,
218*7594170eSAndroid Build Coastguard Worker    extra_target_under_test_aspects = [_compile_action_argv_aspect],
219*7594170eSAndroid Build Coastguard Worker    config_settings = {
220*7594170eSAndroid Build Coastguard Worker        transition_constants.cli_platforms_key: [
221*7594170eSAndroid Build Coastguard Worker            "@//build/bazel/tests/products:aosp_x86_for_testing_cfi_include_path_linux_x86",
222*7594170eSAndroid Build Coastguard Worker        ],
223*7594170eSAndroid Build Coastguard Worker    },
224*7594170eSAndroid Build Coastguard Worker)
225*7594170eSAndroid Build Coastguard Worker
226*7594170eSAndroid Build Coastguard Workerdef _test_cfi_include_paths_host_no_cfi():
227*7594170eSAndroid Build Coastguard Worker    name = "cfi_include_paths_host_no_cfi"
228*7594170eSAndroid Build Coastguard Worker    test_name = name + "_test"
229*7594170eSAndroid Build Coastguard Worker
230*7594170eSAndroid Build Coastguard Worker    cc_library_shared(
231*7594170eSAndroid Build Coastguard Worker        name = name,
232*7594170eSAndroid Build Coastguard Worker        srcs = ["foo.cpp"],
233*7594170eSAndroid Build Coastguard Worker        tags = ["manual"],
234*7594170eSAndroid Build Coastguard Worker    )
235*7594170eSAndroid Build Coastguard Worker
236*7594170eSAndroid Build Coastguard Worker    _cfi_deps_cfi_includes_paths_host_no_cfi_test(
237*7594170eSAndroid Build Coastguard Worker        name = test_name,
238*7594170eSAndroid Build Coastguard Worker        target_under_test = name,
239*7594170eSAndroid Build Coastguard Worker        flags = [_generated_sanitizer_constants.CfiCrossDsoFlag],
240*7594170eSAndroid Build Coastguard Worker        targets_with_flag = [],
241*7594170eSAndroid Build Coastguard Worker        targets_without_flag = [name + shared_or_binary_cpp_suffix],
242*7594170eSAndroid Build Coastguard Worker    )
243*7594170eSAndroid Build Coastguard Worker
244*7594170eSAndroid Build Coastguard Worker    return test_name
245*7594170eSAndroid Build Coastguard Worker
246*7594170eSAndroid Build Coastguard Worker_cfi_exclude_paths_no_cfi_test = analysistest.make(
247*7594170eSAndroid Build Coastguard Worker    transition_deps_test_impl,
248*7594170eSAndroid Build Coastguard Worker    attrs = transition_deps_test_attrs,
249*7594170eSAndroid Build Coastguard Worker    extra_target_under_test_aspects = [_compile_action_argv_aspect],
250*7594170eSAndroid Build Coastguard Worker    config_settings = {
251*7594170eSAndroid Build Coastguard Worker        transition_constants.cli_platforms_key: [
252*7594170eSAndroid Build Coastguard Worker            "@//build/bazel/tests/products:aosp_x86_for_testing_cfi_exclude_path",
253*7594170eSAndroid Build Coastguard Worker        ],
254*7594170eSAndroid Build Coastguard Worker    },
255*7594170eSAndroid Build Coastguard Worker)
256*7594170eSAndroid Build Coastguard Worker
257*7594170eSAndroid Build Coastguard Workerdef _test_cfi_exclude_paths_disable_cfi():
258*7594170eSAndroid Build Coastguard Worker    name = "cfi_exclude_paths_disable_cfi"
259*7594170eSAndroid Build Coastguard Worker    test_name = name + "_test"
260*7594170eSAndroid Build Coastguard Worker
261*7594170eSAndroid Build Coastguard Worker    cc_library_shared(
262*7594170eSAndroid Build Coastguard Worker        name = name,
263*7594170eSAndroid Build Coastguard Worker        srcs = ["foo.cpp"],
264*7594170eSAndroid Build Coastguard Worker        features = ["android_cfi"],
265*7594170eSAndroid Build Coastguard Worker        tags = ["manual"],
266*7594170eSAndroid Build Coastguard Worker    )
267*7594170eSAndroid Build Coastguard Worker
268*7594170eSAndroid Build Coastguard Worker    _cfi_exclude_paths_no_cfi_test(
269*7594170eSAndroid Build Coastguard Worker        name = test_name,
270*7594170eSAndroid Build Coastguard Worker        target_under_test = name,
271*7594170eSAndroid Build Coastguard Worker        flags = [_generated_sanitizer_constants.CfiCrossDsoFlag],
272*7594170eSAndroid Build Coastguard Worker        targets_with_flag = [],
273*7594170eSAndroid Build Coastguard Worker        targets_without_flag = [name + shared_or_binary_cpp_suffix],
274*7594170eSAndroid Build Coastguard Worker    )
275*7594170eSAndroid Build Coastguard Worker
276*7594170eSAndroid Build Coastguard Worker    return test_name
277*7594170eSAndroid Build Coastguard Worker
278*7594170eSAndroid Build Coastguard Worker_enable_cfi_false_no_cfi_test = analysistest.make(
279*7594170eSAndroid Build Coastguard Worker    transition_deps_test_impl,
280*7594170eSAndroid Build Coastguard Worker    attrs = transition_deps_test_attrs,
281*7594170eSAndroid Build Coastguard Worker    extra_target_under_test_aspects = [_compile_action_argv_aspect],
282*7594170eSAndroid Build Coastguard Worker    config_settings = {
283*7594170eSAndroid Build Coastguard Worker        transition_constants.enable_cfi_key: False,
284*7594170eSAndroid Build Coastguard Worker    },
285*7594170eSAndroid Build Coastguard Worker)
286*7594170eSAndroid Build Coastguard Worker
287*7594170eSAndroid Build Coastguard Workerdef _test_enable_cfi_false_disables_cfi_globally():
288*7594170eSAndroid Build Coastguard Worker    name = "enable_cfi_false_disables_cfi_globally"
289*7594170eSAndroid Build Coastguard Worker    test_name = name + "_test"
290*7594170eSAndroid Build Coastguard Worker
291*7594170eSAndroid Build Coastguard Worker    cc_library_shared(
292*7594170eSAndroid Build Coastguard Worker        name = name,
293*7594170eSAndroid Build Coastguard Worker        srcs = ["foo.cpp"],
294*7594170eSAndroid Build Coastguard Worker        features = ["android_cfi"],
295*7594170eSAndroid Build Coastguard Worker        tags = ["manual"],
296*7594170eSAndroid Build Coastguard Worker    )
297*7594170eSAndroid Build Coastguard Worker
298*7594170eSAndroid Build Coastguard Worker    _enable_cfi_false_no_cfi_test(
299*7594170eSAndroid Build Coastguard Worker        name = test_name,
300*7594170eSAndroid Build Coastguard Worker        target_under_test = name,
301*7594170eSAndroid Build Coastguard Worker        flags = [_generated_sanitizer_constants.CfiCrossDsoFlag],
302*7594170eSAndroid Build Coastguard Worker        targets_with_flag = [],
303*7594170eSAndroid Build Coastguard Worker        targets_without_flag = [name + shared_or_binary_cpp_suffix],
304*7594170eSAndroid Build Coastguard Worker    )
305*7594170eSAndroid Build Coastguard Worker
306*7594170eSAndroid Build Coastguard Worker    return test_name
307*7594170eSAndroid Build Coastguard Worker
308*7594170eSAndroid Build Coastguard Workerdef cfi_transition_test_suite(name):
309*7594170eSAndroid Build Coastguard Worker    native.test_suite(
310*7594170eSAndroid Build Coastguard Worker        name = name,
311*7594170eSAndroid Build Coastguard Worker        tests = [
312*7594170eSAndroid Build Coastguard Worker            _test_cfi_propagates_to_static_deps(),
313*7594170eSAndroid Build Coastguard Worker            _test_cfi_does_not_propagate_to_shared_deps(),
314*7594170eSAndroid Build Coastguard Worker            _test_cfi_disabled_propagates_to_static_deps(),
315*7594170eSAndroid Build Coastguard Worker            _test_cfi_binary_propagates_to_static_deps(),
316*7594170eSAndroid Build Coastguard Worker            _test_cfi_include_paths_enables_cfi_for_device(),
317*7594170eSAndroid Build Coastguard Worker            _test_cfi_include_paths_host_no_cfi(),
318*7594170eSAndroid Build Coastguard Worker            _test_cfi_exclude_paths_disable_cfi(),
319*7594170eSAndroid Build Coastguard Worker            _test_enable_cfi_false_disables_cfi_globally(),
320*7594170eSAndroid Build Coastguard Worker        ],
321*7594170eSAndroid Build Coastguard Worker    )
322