Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0 |
Wang Nan | 00b8669 | 2016-11-26 07:03:34 +0000 | [diff] [blame] | 2 | #include "tests.h" |
Wang Nan | 00b8669 | 2016-11-26 07:03:34 +0000 | [diff] [blame] | 3 | #include "c++/clang-c.h" |
Arnaldo Carvalho de Melo | 877a7a1 | 2017-04-17 11:39:06 -0300 | [diff] [blame] | 4 | #include <linux/kernel.h> |
Wang Nan | 00b8669 | 2016-11-26 07:03:34 +0000 | [diff] [blame] | 5 | |
Wang Nan | 00b8669 | 2016-11-26 07:03:34 +0000 | [diff] [blame] | 6 | #ifndef HAVE_LIBCLANGLLVM_SUPPORT |
Ian Rogers | 44a8528 | 2021-11-03 23:41:58 -0700 | [diff] [blame] | 7 | static int test__clang_to_IR(struct test_suite *test __maybe_unused, |
| 8 | int subtest __maybe_unused) |
Wang Nan | 00b8669 | 2016-11-26 07:03:34 +0000 | [diff] [blame] | 9 | { |
| 10 | return TEST_SKIP; |
| 11 | } |
Ian Rogers | 44a8528 | 2021-11-03 23:41:58 -0700 | [diff] [blame] | 12 | |
| 13 | static int test__clang_to_obj(struct test_suite *test __maybe_unused, |
| 14 | int subtest __maybe_unused) |
Wang Nan | 00b8669 | 2016-11-26 07:03:34 +0000 | [diff] [blame] | 15 | { |
Ian Rogers | 44a8528 | 2021-11-03 23:41:58 -0700 | [diff] [blame] | 16 | return TEST_SKIP; |
Wang Nan | 00b8669 | 2016-11-26 07:03:34 +0000 | [diff] [blame] | 17 | } |
| 18 | #endif |
Ian Rogers | d68f036 | 2021-11-03 23:41:50 -0700 | [diff] [blame] | 19 | |
Ian Rogers | 44a8528 | 2021-11-03 23:41:58 -0700 | [diff] [blame] | 20 | static struct test_case clang_tests[] = { |
| 21 | TEST_CASE_REASON("builtin clang compile C source to IR", clang_to_IR, |
| 22 | "not compiled in"), |
| 23 | TEST_CASE_REASON("builtin clang compile C source to ELF object", |
| 24 | clang_to_obj, |
| 25 | "not compiled in"), |
| 26 | { .name = NULL, } |
| 27 | }; |
| 28 | |
Ian Rogers | 33f44bf | 2021-11-03 23:41:51 -0700 | [diff] [blame] | 29 | struct test_suite suite__clang = { |
Ian Rogers | d68f036 | 2021-11-03 23:41:50 -0700 | [diff] [blame] | 30 | .desc = "builtin clang support", |
Ian Rogers | 44a8528 | 2021-11-03 23:41:58 -0700 | [diff] [blame] | 31 | .test_cases = clang_tests, |
Ian Rogers | d68f036 | 2021-11-03 23:41:50 -0700 | [diff] [blame] | 32 | }; |