misc-ps-region-store.cpp revision 949bdb43bf370b23a79a37b017e0a0566c0d66e0
1// RUN: %clang_cc1 -triple i386-apple-darwin9 -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -verify -fblocks -analyzer-opt-analyze-nested-blocks %s 2// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -verify -fblocks -analyzer-opt-analyze-nested-blocks %s 3 4// Test basic handling of references. 5char &test1_aux(); 6char *test1() { 7 return &test1_aux(); 8} 9 10// Test test1_aux() evaluates to char &. 11char test1_as_rvalue() { 12 return test1_aux(); 13} 14 15// Test passing a value as a reference. The 'const' in test2_aux() adds 16// an ImplicitCastExpr, which is evaluated as an lvalue. 17int test2_aux(const int &n); 18int test2(int n) { 19 return test2_aux(n); 20} 21 22int test2_b_aux(const short &n); 23int test2_b(int n) { 24 return test2_b_aux(n); 25} 26