1*c558b1fcSGeorgy Komarov // RUN: %clang_analyze_cc1 -std=c++14 -triple x86_64-linux-gnu -analyzer-checker=optin.performance -analyzer-config optin.performance.Padding:AllowedPad=2 -verify %s
2*c558b1fcSGeorgy Komarov 
3*c558b1fcSGeorgy Komarov class Empty {}; // no-warning
4*c558b1fcSGeorgy Komarov 
5*c558b1fcSGeorgy Komarov // expected-warning@+1{{Excessive padding in 'struct NoUniqueAddressWarn1' (6 padding}}
6*c558b1fcSGeorgy Komarov struct NoUniqueAddressWarn1 {
7*c558b1fcSGeorgy Komarov   char c1;
8*c558b1fcSGeorgy Komarov   [[no_unique_address]] Empty empty;
9*c558b1fcSGeorgy Komarov   int i;
10*c558b1fcSGeorgy Komarov   char c2;
11*c558b1fcSGeorgy Komarov };
12*c558b1fcSGeorgy Komarov 
13*c558b1fcSGeorgy Komarov // expected-warning@+1{{Excessive padding in 'struct NoUniqueAddressWarn2' (6 padding}}
14*c558b1fcSGeorgy Komarov struct NoUniqueAddressWarn2 {
15*c558b1fcSGeorgy Komarov     char c1;
16*c558b1fcSGeorgy Komarov     [[no_unique_address]] Empty e1, e2;
17*c558b1fcSGeorgy Komarov     int i;
18*c558b1fcSGeorgy Komarov     char c2;
19*c558b1fcSGeorgy Komarov };
20*c558b1fcSGeorgy Komarov 
21*c558b1fcSGeorgy Komarov struct NoUniqueAddressNoWarn1 {
22*c558b1fcSGeorgy Komarov   char c1;
23*c558b1fcSGeorgy Komarov   [[no_unique_address]] Empty empty;
24*c558b1fcSGeorgy Komarov   char c2;
25*c558b1fcSGeorgy Komarov };
26*c558b1fcSGeorgy Komarov 
27*c558b1fcSGeorgy Komarov struct NoUniqueAddressNoWarn2 {
28*c558b1fcSGeorgy Komarov   char c1;
29*c558b1fcSGeorgy Komarov   [[no_unique_address]] Empty e1, e2;
30*c558b1fcSGeorgy Komarov };
31