Debian Codegraph @

gcc/testsuite/g++.dg/modules/pr119076-1_a.H

raw
1 // { dg-additional-options "-fmodule-header -Wno-pedantic" }
2 // { dg-module-cmi {} }
3
4 constexpr unsigned char a[] = {
5 #embed __FILE__
6 };
7
8 constexpr int
9 foo (const unsigned char *p, int s)
10 {
11 int r = 0;
12 for (int i = 0; i < s; ++i)
13 r += p[i];
14 return r;
15 }
16
17 constexpr int b = foo (a, sizeof a);
18
19 inline int
20 bar ()
21 {
22 const unsigned char b[] = {
23 #embed __FILE__
24 };
25 int r = 0;
26 for (int i = 0; i < sizeof b; ++i)
27 r += b[i];
28 return r;
29 }
30
31 inline int
32 baz ()
33 {
34 const long int c[] = {
35 #embed __FILE__
36 };
37 int r = 0;
38 for (int i = 0; i < sizeof (c) / sizeof (c[0]); ++i)
39 r += c[i];
40 return r;
41 }