1 /* { dg-do run { target { { i?86-*-* x86_64-*-* } && lp64 } } } */
2 /* { dg-options "-g" } */
3 
4 volatile int vv;
5 
6 __attribute__((noclone, noinline)) long
f1(unsigned long x)7 f1 (unsigned long x)
8 {
9   long f = (x << 12) | (x >> (64 - 12));
10   long g = f;
11   asm volatile ("" : "+r" (f));
12   vv++;		/* { dg-final { gdb-test 12 "g" "f" } } */
13   return f;
14 }
15 
16 __attribute__((noclone, noinline)) long
f2(unsigned long x,int y)17 f2 (unsigned long x, int y)
18 {
19   long f = (x << y) | (x >> (64 - y));
20   long g = f;
21   asm volatile ("" : "+r" (f));
22   vv++;		/* { dg-final { gdb-test 22 "g" "f" } } */
23   return f;
24 }
25 
26 __attribute__((noclone, noinline)) long
f3(unsigned long x,int y)27 f3 (unsigned long x, int y)
28 {
29   long f = (x >> y) | (x << (64 - y));
30   long g = f;
31   asm volatile ("" : "+r" (f));
32   vv++;		/* { dg-final { gdb-test 32 "g" "f" } } */
33   return f;
34 }
35 
36 __attribute__((noclone, noinline)) unsigned int
f4(unsigned int x)37 f4 (unsigned int x)
38 {
39   unsigned int f = (x << 12) | (x >> (32 - 12));
40   unsigned int g = f;
41   asm volatile ("" : "+r" (f));
42   vv++;		/* { dg-final { gdb-test 42 "g" "f" } } */
43   return f;
44 }
45 
46 __attribute__((noclone, noinline)) unsigned int
f5(unsigned int x,int y)47 f5 (unsigned int x, int y)
48 {
49   unsigned int f = (x << y) | (x >> (32 - y));
50   unsigned int g = f;
51   asm volatile ("" : "+r" (f));
52   vv++;		/* { dg-final { gdb-test 52 "g" "f" } } */
53   return f;
54 }
55 
56 __attribute__((noclone, noinline)) unsigned int
f6(unsigned int x,int y)57 f6 (unsigned int x, int y)
58 {
59   unsigned int f = (x >> y) | (x << (32 - y));
60   unsigned int g = f;
61   asm volatile ("" : "+r" (f));
62   vv++;		/* { dg-final { gdb-test 62 "g" "f" } } */
63   return f;
64 }
65 
66 int
main()67 main ()
68 {
69   f1 (0x123456789abcde0fUL);
70   f2 (0x123456789abcde0fUL, 18);
71   f3 (0x123456789abcde0fUL, 17);
72   f4 (0x12345678);
73   f5 (0x12345678, 18);
74   f6 (0x12345678, 17);
75   return 0;
76 }
77