1 /*
2 * Copyright (c) 2012-2014 Wind River Systems, Inc.
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7 #include <zephyr/kernel.h>
8 #include <zephyr/sys/printk.h>
9 #include <zephyr/ztest.h>
10
11 __in_section(data, sram, var) uint32_t var_file3_sram_data = 10U;
__in_section(bss,sram2,var)12 __in_section(bss, sram2, var) uint32_t var_file3_sram2_bss;
13
14 ZTEST(code_relocation, test_function_in_split_multiple)
15 {
16 extern uintptr_t __data_start;
17 extern uintptr_t __data_end;
18 extern uintptr_t __sram2_bss_reloc_start;
19 extern uintptr_t __sram2_bss_reloc_end;
20
21 printk("Address of var_file3_sram_data %p\n", &var_file3_sram_data);
22 printk("Address of var_file3_sram2_bss %p\n\n", &var_file3_sram2_bss);
23
24 zassert_between_inclusive((uintptr_t)&var_file3_sram_data,
25 (uintptr_t)&__data_start,
26 (uintptr_t)&__data_end,
27 "var_file3_sram_data not in sram_data region");
28 zassert_between_inclusive((uintptr_t)&var_file3_sram2_bss,
29 (uintptr_t)&__sram2_bss_reloc_start,
30 (uintptr_t)&__sram2_bss_reloc_end,
31 "var_file3_sram2_bss not in sram2_bss region");
32 }
33