1/* Test cases of structures with volatile fields declared register: 2 should be allowed unless register name given but explicitly taking 3 the address forbidden. */ 4/* Origin: Joseph Myers <jsm@polyomino.org.uk> */ 5 6/* { dg-do compile } */ 7 8struct S { volatile int field; }; 9 10void 11f (void) 12{ 13 register struct S a; 14 register struct S b[2]; 15 register struct S c __asm__("nosuchreg"); /* { dg-error "object with volatile field" "explicit reg name" } */ 16 &a; /* { dg-error "address of register" "explicit address" } */ 17 b; /* { dg-error "address of register" "implicit address" } */ 18} 19