// RUN: %clang_analyze_cc1 -analyzer-checker=core,alpha.core.CastToStruct -verify %s
;
typedef struct STYPE;
void ;
void ;
// Array to pointer conversion. Array in the struct field.
void
// StringLiteral in lvalue context and pointer to array type.
// p: ElementRegion, q: StringRegion
void
// Typedef'ed struct definition.
void
// Initialize array with InitExprList.
void
// Struct variable in lvalue context.
// Assign UnknownVal to the whole struct.
void
// AllocaRegion test.
void
;
void ;
// Incomplete struct pointer used as function argument.
void
// sizeof() is unsigned while -1 is signed in array index.
void
// Initialization of struct array elements.
void
// Initializing array with string literal.
void
// Retrieve the default value of element/field region.
void
// Convert unsigned offset to signed when creating ElementRegion from
// SymbolicRegion.
void
;
// The binding of a.e.d should not be removed. Test recursive subregion map
// building: a->e, e->d. Only then 'a' could be added to live region roots.
void
;
static struct s3 opt;
// Test if the embedded array is retrieved correctly.
void
void ;
struct s3
void
// Test if the array is correctly invalidated.
void
struct s3 p;
// Code from postgresql.
// Current cast logic of region store mistakenly leaves the final result region
// an ElementRegion of type 'char'. Then load a nonloc::SymbolVal from it and
// assigns to 'a'.
void
void ;
// Invalidate the struct field.
void
void ;
void
// [PR13927] offsetof replacement macro flagged as "dereference of a null pointer"
int
int
int