reference.cpp revision fc61d94fbdbcd2b423976e21f24d423fcd442486
1// RUN: %clang_cc1 -analyze -analyzer-experimental-internal-checks -analyzer-check-objc-mem -analyzer-store=region -analyzer-constraints=range -verify %s 2 3void f1() { 4 int const &i = 3; 5 int b = i; 6 7 int *p = 0; 8 9 if (b != 3) 10 *p = 1; // no-warning 11} 12 13char* ptr(); 14char& ref(); 15 16// These next two tests just shouldn't crash. 17char t1 () { 18 ref() = 'c'; 19 return '0'; 20} 21 22// just a sanity test, the same behavior as t1() 23char t2 () { 24 *ptr() = 'c'; 25 return '0'; 26} 27