1 // SPDX-License-Identifier: GPL-2.0
5 #include "c++/clang-c.h"
6 #include <linux/kernel.h>
11 } clang_testcase_table[] = {
12 #ifdef HAVE_LIBCLANGLLVM_SUPPORT
14 .func = test__clang_to_IR,
15 .desc = "builtin clang compile C source to IR",
18 .func = test__clang_to_obj,
19 .desc = "builtin clang compile C source to ELF object",
24 int test__clang_subtest_get_nr(void)
26 return (int)ARRAY_SIZE(clang_testcase_table);
29 const char *test__clang_subtest_get_desc(int i)
31 if (i < 0 || i >= (int)ARRAY_SIZE(clang_testcase_table))
33 return clang_testcase_table[i].desc;
36 #ifndef HAVE_LIBCLANGLLVM_SUPPORT
37 int test__clang(struct test *test __maybe_unused, int i __maybe_unused)
42 int test__clang(struct test *test __maybe_unused, int i)
44 if (i < 0 || i >= (int)ARRAY_SIZE(clang_testcase_table))
46 return clang_testcase_table[i].func();