| // SPDX-License-Identifier: GPL-2.0 |
| #include <linux/kernel.h> |
| } clang_testcase_table[] = { |
| #ifdef HAVE_LIBCLANGLLVM_SUPPORT |
| .func = test__clang_to_IR, |
| .desc = "builtin clang compile C source to IR", |
| .func = test__clang_to_obj, |
| .desc = "builtin clang compile C source to ELF object", |
| int test__clang_subtest_get_nr(void) |
| return (int)ARRAY_SIZE(clang_testcase_table); |
| const char *test__clang_subtest_get_desc(int i) |
| if (i < 0 || i >= (int)ARRAY_SIZE(clang_testcase_table)) |
| return clang_testcase_table[i].desc; |
| #ifndef HAVE_LIBCLANGLLVM_SUPPORT |
| int test__clang(struct test *test __maybe_unused, int i __maybe_unused) |
| int test__clang(struct test *test __maybe_unused, int i) |
| if (i < 0 || i >= (int)ARRAY_SIZE(clang_testcase_table)) |
| return clang_testcase_table[i].func(); |