// RUN: %clang_analyze_cc1 -verify %s \
// RUN: -analyzer-checker=optin.performance \
// RUN: -analyzer-config optin.performance.Padding:AllowedPad=2
// RUN: not %clang_analyze_cc1 -verify %s \
// RUN: -analyzer-checker=core \
// RUN: -analyzer-checker=optin.performance.Padding \
// RUN: -analyzer-config optin.performance.Padding:AllowedPad=-10 \
// RUN: 2>&1 | FileCheck %s -check-prefix=CHECK-PAD-NEGATIVE-VALUE
// CHECK-PAD-NEGATIVE-VALUE: (frontend): invalid input for checker option
// CHECK-PAD-NEGATIVE-VALUE-SAME: 'optin.performance.Padding:AllowedPad', that
// CHECK-PAD-NEGATIVE-VALUE-SAME: expects a non-negative value
// expected-warning@+1{{Excessive padding in 'struct FieldAttrAlign' (6 padding}}
;
// expected-warning@+1{{Excessive padding in 'struct FieldAttrOverAlign' (10 padding}}
;
// __has_include(<stdalign.h>) || defined(__cplusplus)
// Re-ordering members of these structs won't reduce padding, so don't warn
;
;
;
;
// Re-ordering members of these structs will reduce padding, so warn
;
;
;
;
;
;
;
;
;
;
// Currently ignoring VLA padding problems. Still need to make sure we don't
// choke on VLAs though
;
// Currently ignoring bitfield padding problems. Still need to make sure we
// don't choke on bitfields though
;
typedef struct TypedefSandwich;
// expected-warning@+1{{Excessive padding in 'struct StructAttrAlign' (10 padding}}
;
;
;
;
void
void
void
;
;
// expected-warning@+1{{Excessive padding in 'struct SmallArrayShortSandwich'}}
ShortArray;
// expected-warning@+1{{Excessive padding in 'struct SmallArrayInFunc'}}
;
void
// xxxexpected-warning@+1{{Excessive padding in 'struct SmallArrayInStruct'}}
;
HoldsSmallArrayElt;
void