repo.or.cz
/
official-gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
2018-11-07 Richard Biener <rguenther@suse.de>
[official-gcc.git]
/
gcc
/
testsuite
/
g++.dg
/
ubsan
/
align-1.C
blob
65b1222a5c063120ce52b719e6761e363e475232
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
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
}