// RUN: %clang_analyze_cc1 -triple i386-apple-darwin9 -analyzer-checker=core,alpha.core,debug.ExprInspection -verify -fblocks %s -fexceptions -fcxx-exceptions -Wno-tautological-undefined-compare
// RUN: %clang_analyze_cc1 -triple x86_64-apple-darwin9 -analyzer-checker=core,alpha.core,debug.ExprInspection -verify -fblocks %s -fexceptions -fcxx-exceptions -Wno-tautological-undefined-compare
void ;
// Test basic handling of references.
char &;
char *
// Test test1_aux() evaluates to char &.
char
// Test passing a value as a reference. The 'const' in test2_aux() adds
// an ImplicitCastExpr, which is evaluated as an lvalue.
int ;
int
int ;
int
// Test getting the lvalue of a derived and converting it to a base. This
// previously crashed.
;
;
int ;
int
//===---------------------------------------------------------------------===//
// Test CFG support for C++ condition variables.
//===---------------------------------------------------------------------===//
int ;
int
int
int
int
//===---------------------------------------------------------------------===//
// Test handling of 'this' pointer.
//===---------------------------------------------------------------------===//
;
int
int
int
// PR 7675 - passing literals by-reference
void ;
void ;
void ;
void ;
void
// <rdar://problem/8375510> - CFGBuilder should handle temporaries.
;
int
// PR8419 -- this used to crash.
;
char& ;
void
// PR8426 -- this used to crash.
void ;
;
Foo<T>::~
// PR8427 -- this used to crash.
;
bool ;
;
bool
// PR8433 -- this used to crash.
;
void
//===---------------------------------------------------------------------===//
// Handle misc. C++ constructs.
//===---------------------------------------------------------------------===//
;
void
// Test handling methods that accept references as parameters, and that
// variables are properly invalidated.
;
bool
// Test handling of new[].
void
// Test basic support for dynamic_cast<>.
;
;
;
const Rdar9212495_A&
const Rdar9212495_A*
// Test constructors invalidating arguments. Previously this raised
// an uninitialized value warning.
extern "C" void ;
;
void
:
void
// Invalidate fields during C++ method calls.
;
void
void
void
// Test reference parameters.
void ;
float
// Test invalidation of class fields.
;
void ;
int
// Test correct pointer arithmetic using 'p--'. This is to warn that we
// were loading beyond the written characters in buf.
char *
// Test that we invalidate byref arguments passed to constructors.
;
unsigned
unsigned
// Test assigning into a symbolic offset.
;
void
// Test loads from static fields. This previously triggered an uninitialized
// value warning.
;
int
int
// Regression test against global constants and switches.
;
const rdar10202899_ValT val = rdar10202899_ValTA;
void
void
void
// This used to crash the analyzer because of the unnamed bitfield.
void
// Handle doing a load from the memory associated with the code for
// a function.
extern double ;
double
// Test that 'this' is assumed non-null upon analyzing the entry to a "top-level"
// function (i.e., when not analyzing from a specific caller).
;
void
// Test handling of 'catch' exception variables, and not warning
// about uninitialized values.
;
MyEnum
MyEnum
// Test handling of catch with no condition variable.
void
void
// Test handling taking the address of a field. While the analyzer
// currently doesn't do anything intelligent here, this previously
// resulted in a crash.
;
;
void
// Test symbolicating a reference. In this example, the
// analyzer (originally) didn't know how to handle x[index - index2],
// returning an UnknownVal. The conjured symbol wasn't a location,
// and would result in a crash.
void
// Test handling CXXScalarValueInitExprs.
void
//===---------------------------------------------------------------------===//
// Handle inlining of C++ method calls.
//===---------------------------------------------------------------------===//
;
void
void
//===---------------------------------------------------------------------===//
// Random tests.
//===---------------------------------------------------------------------===//
// Tests assigning using a C-style initializer to a struct
// variable whose sub-field is also a struct. This currently
// results in a CXXTempObjectRegion being created, but not
// properly handled. For now, we just ignore that value
// to avoid a crash (<rdar://problem/12753384>).
;
;
unsigned
// This testcase tests whether we treat the anonymous union and union
// the same way. This previously resulted in a "return of stack address"
// warning because the anonymous union resulting in a temporary object
// getting put into the initializer. We still aren't handling this correctly,
// but now if a temporary object appears in an initializer we just ignore it.
// Fixes <rdar://problem/12755044>.
;
;
const Rdar12755044_foo_anon *
const Rdar12755044_foo *
// Test the correct handling of integer to bool conversions. Previously
// this resulted in a false positive because integers were being truncated
// and not tested for non-zero.
void
// The analyzer currently does not model complex types. Test that the load
// from 'x' is not flagged as being uninitialized.
typedef __complex__ float _ComplexT;
void
void
// Test case for PR 12921. This previously produced
// a bogus warning.
static const int pr12921_arr = ;
static const int pr12921_arrcount = sizeof/sizeof;
int