1 /* { dg-do run } */
2 /* { dg-options "-O2" } */
3 
4 __attribute__ ((noinline, noclone)) void
clobber_lr_and_highregs(void)5 clobber_lr_and_highregs (void)
6 {
7   __asm__ volatile ("" : : : "r8", "r9", "lr");
8 }
9 
10 int
main(void)11 main (void)
12 {
13   int ret;
14 
15   __asm volatile ("mov\tr4, #0xf4\n\t"
16 		  "mov\tr5, #0xf5\n\t"
17 		  "mov\tr6, #0xf6\n\t"
18 		  "mov\tr7, #0xf7\n\t"
19 		  "mov\tr0, #0xf8\n\t"
20 		  "mov\tr8, r0\n\t"
21 		  "mov\tr0, #0xfa\n\t"
22 		  "mov\tr10, r0"
23 		  : : : "r0", "r4", "r5", "r6", "r7", "r8", "r10");
24 
25   clobber_lr_and_highregs ();
26 
27   __asm volatile ("cmp\tr4, #0xf4\n\t"
28 		  "bne\tfail\n\t"
29 		  "cmp\tr5, #0xf5\n\t"
30 		  "bne\tfail\n\t"
31 		  "cmp\tr6, #0xf6\n\t"
32 		  "bne\tfail\n\t"
33 		  "cmp\tr7, #0xf7\n\t"
34 		  "bne\tfail\n\t"
35 		  "mov\tr0, r8\n\t"
36 		  "cmp\tr0, #0xf8\n\t"
37 		  "bne\tfail\n\t"
38 		  "mov\tr0, r10\n\t"
39 		  "cmp\tr0, #0xfa\n\t"
40 		  "bne\tfail\n\t"
41 		  "mov\t%0, #1\n"
42 		  "fail:\n\t"
43 		  "sub\tr0, #1"
44 		  : "=r" (ret) : :);
45   return ret;
46 }
47