PR tree-optimization/81303
[official-gcc.git] / gcc / testsuite / gcc.dg / guality / rotatetest.c
blobd44c2807a42a0e782a20a018f0779df19476a887
1 /* { dg-do run { target { { i?86-*-* x86_64-*-* } && lp64 } } } */
2 /* { dg-options "-g" } */
4 volatile int vv;
6 __attribute__((noclone, noinline)) long
7 f1 (unsigned long x)
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;
16 __attribute__((noclone, noinline)) long
17 f2 (unsigned long x, int y)
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;
26 __attribute__((noclone, noinline)) long
27 f3 (unsigned long x, int y)
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;
36 __attribute__((noclone, noinline)) unsigned int
37 f4 (unsigned int x)
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;
46 __attribute__((noclone, noinline)) unsigned int
47 f5 (unsigned int x, int y)
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;
56 __attribute__((noclone, noinline)) unsigned int
57 f6 (unsigned int x, int y)
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;
66 int
67 main ()
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;