1 /* { dg-do compile } */ 2 /* { dg-options "-O1 */ 3 4 5 #define __aux() __attribute__((aux)) 6 7 __aux() int *a_ptr; 8 extern __aux() int a_var; 9 10 /* Generates: 11 mov r0, @a_var 12 sr 10,[r0] 13 */ foo(void)14void foo (void) 15 { 16 a_var = 10; 17 } 18 19 /* Generates: 20 mov r0, @a_ptr 21 sr a_var,[r0] 22 */ foo1(void)23void foo1 (void) 24 { 25 a_ptr = &a_var; 26 } 27 28 /* Generates: 29 lr %r1,[a_ptr] 30 sr 10,[%r1] 31 */ foo2(void)32void foo2 (void) 33 { 34 *a_ptr = 10; 35 } 36 37 /* { dg-final { scan-assembler-times "sr" 3 } } */ 38 /* { dg-final { scan-assembler-times "lr" 1 } } */ 39