PR middle-end/77357 - strlen of constant strings not folded
[official-gcc.git] / gcc / testsuite / gcc.dg / pr57134.c
blobb834b0b159d324219fa2ef38ae1fe4be2f206a90
1 /* { dg-do compile } */
2 /* { dg-require-effective-target stdint_types } */
3 /* { dg-options "-O2" } */
4 /* { dg-options "-O2 -mstrict-align" { target { powerpc*-*-linux* powerpc*-*-elf* } } } */
6 #include <stdint.h>
8 typedef struct {
9 int64_t counter;
10 } atomic64_t;
12 struct buffer_page {
13 void *a, *b;
14 atomic64_t entries;
17 static __inline__ __attribute__((always_inline)) int64_t
18 atomic64_read(const atomic64_t *v)
20 int64_t t;
21 __asm__ __volatile__("" : "=r"(t) : "m"(v->counter));
22 return t;
25 int rb_remove_pages(void *p)
27 struct buffer_page *blah = (void *)((intptr_t) p & -4);
28 return atomic64_read(&blah->entries);