Debian Codegraph @

clang/test/Preprocessor/embed_init.c

raw
1 // RUN: %clang_cc1 -std=c23 %s -fsyntax-only --embed-dir=%S/Inputs -verify
2 // RUN: %clang_cc1 -std=c23 %s -fsyntax-only --embed-dir=%S/Inputs -verify -fexperimental-new-constant-interpreter
3 // expected-no-diagnostics
4
5 typedef struct kitty {
6 int purr;
7 } kitty;
8
9 typedef struct kitty_kitty {
10 int here;
11 kitty kit;
12 } kitty_kitty;
13
14 const int meow =
15 #embed <single_byte.txt>
16 ;
17
18 const kitty kit = {
19 #embed <single_byte.txt>
20 };
21
22 const kitty_kitty kit_kit = {
23 #embed <jk.txt>
24 };
25
26 static_assert(meow == 'b');
27 static_assert(kit.purr == 'b');
28 static_assert(kit_kit.here == 'j');
29 static_assert(kit_kit.kit.purr == 'k');