1 // { dg-do run }
2 // { dg-options "-fsanitize=alignment -Wall -Wno-unused-variable -std=c++11" }
3 
4 typedef const long int L;
5 int a = 1;
6 L b = 2;
7 
8 int
main(void)9 main (void)
10 {
11   int *p = &a;
12   L *l = &b;
13 
14   int &r = *p;
15   auto &r2 = *p;
16   L &lr = *l;
17 
18   // Try an rvalue reference.
19   auto &&r3 = *p;
20 
21   // Don't evaluate the reference initializer twice.
22   int i = 1;
23   int *q = &i;
24   int &qr = ++*q;
25   if (i != 2)
26     __builtin_abort ();
27 }
28