Mercurial > hg > CbC > CbC_gcc
view gcc/testsuite/gcc.dg/reg-vol-struct-1.c @ 145:1830386684a0
gcc-9.2.0
author | anatofuz |
---|---|
date | Thu, 13 Feb 2020 11:34:05 +0900 |
parents | 04ced10e8804 |
children |
line wrap: on
line source
/* Test cases of structures with volatile fields declared register: should be allowed unless register name given but explicitly taking the address forbidden. */ /* Origin: Joseph Myers <jsm@polyomino.org.uk> */ /* { dg-do compile } */ struct S { volatile int field; }; void f (void) { register struct S a; register struct S b[2]; register struct S c __asm__("nosuchreg"); /* { dg-error "object with volatile field" "explicit reg name" } */ &a; /* { dg-error "address of register" "explicit address" } */ b; /* { dg-error "address of register" "implicit address" } */ }