1 /*
2  * Copyright (c) 2024 Intel Corporation.
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 /* Test importing symbols, exported by other LLEXTs */
8 
9 #include <zephyr/ztest.h>
10 #include <zephyr/llext/symbol.h>
11 #include <zephyr/sys/util.h>
12 
13 extern long test_dependency(int a, int b);
14 
test_entry(void)15 void test_entry(void)
16 {
17 	unsigned long half_ptr_bits = sizeof(uintptr_t) * 8 / 2;
18 	unsigned long mask = BIT(half_ptr_bits) - 1;
19 	int a = mask & (uintptr_t)test_entry;
20 	int b = mask & ((uintptr_t)test_entry >> half_ptr_bits);
21 
22 	zassert_equal(test_dependency(a, b), (long)a * b);
23 }
24 EXPORT_SYMBOL(test_entry);
25