2 // RUN: mkdir -p %t/media && cp %S/Inputs/media/art.txt %t/media/
3 // RUN: chtag -r %t/media/art.txt
4 // RUN: %clang_cc1 -std=c23 %s -fsyntax-only --embed-dir=%t -verify
5 // expected-no-diagnostics
7 // REQUIRES: shell, system-zos
10 #embed <media/art.txt>
12 const char data2
[] = {
13 #embed <media/art.txt>
16 const char data3
[] = {
17 #embed <media/art.txt> suffix(, 0)
19 const char data4
[] = {
20 #embed <media/art.txt> suffix(,)
23 static_assert(sizeof(data
) == 274);
24 static_assert(' ' == data
[0]);
25 static_assert('_' == data
[11]);
26 static_assert('\n' == data
[273]);
27 static_assert(sizeof(data2
) == 275);
28 static_assert(' ' == data2
[0]);
29 static_assert('_' == data2
[11]);
30 static_assert('\n' == data2
[273]);
31 static_assert('\0' == data2
[274]);
32 static_assert(sizeof(data3
) == 275);
33 static_assert(' ' == data3
[0]);
34 static_assert('_' == data3
[11]);
35 static_assert('\n' == data3
[273]);
36 static_assert('\0' == data3
[274]);
37 static_assert(sizeof(data4
) == 275);
38 static_assert(' ' == data4
[0]);
39 static_assert('_' == data4
[11]);
40 static_assert('\n' == data4
[273]);
41 static_assert('\0' == data4
[274]);
43 const signed char data5
[] = {
44 #embed <media/art.txt>
46 const signed char data6
[] = {
47 #embed <media/art.txt>
50 const signed char data7
[] = {
51 #embed <media/art.txt> suffix(, 0)
53 const signed char data8
[] = {
54 #embed <media/art.txt> suffix(,)
57 static_assert(sizeof(data5
) == 274);
58 static_assert(' ' == data5
[0]);
59 static_assert('_' == data5
[11]);
60 static_assert('\n' == data5
[273]);
61 static_assert(sizeof(data6
) == 275);
62 static_assert(' ' == data6
[0]);
63 static_assert('_' == data6
[11]);
64 static_assert('\n' == data6
[273]);
65 static_assert('\0' == data6
[274]);
66 static_assert(sizeof(data7
) == 275);
67 static_assert(' ' == data7
[0]);
68 static_assert('_' == data7
[11]);
69 static_assert('\n' == data7
[273]);
70 static_assert('\0' == data7
[274]);
71 static_assert(sizeof(data8
) == 275);
72 static_assert(' ' == data8
[0]);
73 static_assert('_' == data8
[11]);
74 static_assert('\n' == data8
[273]);
75 static_assert('\0' == data8
[274]);
77 const unsigned char data9
[] = {
78 #embed <media/art.txt>
80 const unsigned char data10
[] = {
82 #embed <media/art.txt>
84 const unsigned char data11
[] = {
85 #embed <media/art.txt> prefix(0,)
87 const unsigned char data12
[] = {
89 #embed <media/art.txt> prefix(,)
91 static_assert(sizeof(data9
) == 274);
92 static_assert(' ' == data9
[0]);
93 static_assert('_' == data9
[11]);
94 static_assert('\n' == data9
[273]);
95 static_assert(sizeof(data10
) == 275);
96 static_assert(' ' == data10
[1]);
97 static_assert('_' == data10
[12]);
98 static_assert('\n' == data10
[274]);
99 static_assert('\0' == data10
[0]);
100 static_assert(sizeof(data11
) == 275);
101 static_assert(' ' == data11
[1]);
102 static_assert('_' == data11
[12]);
103 static_assert('\n' == data11
[274]);
104 static_assert('\0' == data11
[0]);
105 static_assert(sizeof(data12
) == 275);
106 static_assert(' ' == data12
[1]);
107 static_assert('_' == data12
[12]);
108 static_assert('\n' == data12
[274]);
109 static_assert('\0' == data12
[0]);