3 * { dg-options "-O1" } */
6 [[gnu::noinline
,gnu::noipa
]]
7 int f(int n
, int buf
[n
])
8 [[gnu::access(read_only
, 2, 1)]]
10 return __builtin_dynamic_object_size(buf
, 0);
13 [[gnu::noinline
,gnu::noipa
]]
14 int g(int n
, int buf
[])
15 [[gnu::access(read_only
, 2, 1)]]
17 return __builtin_dynamic_object_size(buf
, 0);
20 [[gnu::noinline
,gnu::noipa
]]
21 int h(int n
, int buf
[n
])
23 return __builtin_dynamic_object_size(buf
, 0);
26 int dummy(int x
) { return x
+ 1; }
28 [[gnu::noinline
,gnu::noipa
]]
29 int i(int n
, int buf
[dummy(n
)])
31 return __builtin_dynamic_object_size(buf
, 0);
38 if (n
* sizeof(int) != f(n
, buf
))
40 if (n
* sizeof(int) != g(n
, buf
))
42 if (n
* sizeof(int) != h(n
, buf
))