1 /* { dg-do run } */
2 /* { dg-require-effective-target int128 } */
3 /* { dg-options "-O -fschedule-insns" } */
4 
5 typedef unsigned char u8;
6 typedef unsigned __int128 u128;
7 
8 static u128 u128_0;
9 static u128 *p128;
10 
11 u128 __attribute__ ((noinline, noclone))
foo(u8 u8_0)12 foo(u8 u8_0)
13 {
14   p128 = &u128_0;
15   u128_0 = u8_0;
16   u128_0 = u128_0 << 127 | u128_0 >> 1;
17   u128_0 >>= (u8)u128_0;
18   return 2 + u128_0;
19 }
20 
21 int
main()22 main()
23 {
24   u128 x = foo(5);
25   if (p128 != &u128_0)
26     __builtin_abort();
27   if (u128_0 != ((u128)2 << 124))
28     __builtin_abort();
29   if (x != ((u128)2 << 124) + 2)
30     __builtin_abort();
31   return 0;
32 }
33