[Heikki Kultala] This patch contains the ABI changes for the TCE target.
[clang.git] / test / SemaObjC / uninit-variables.m
blob63c214053b00bfee3ecbbe7aca678f28b2a1bf8d
1 // RUN: %clang_cc1 -fsyntax-only -Wuninitialized-experimental -fsyntax-only -fblocks %s -verify
3 // Duplicated from uninit-variables.c.
4 // Test just to ensure the analysis is working.
5 int test1() {
6   int x; // expected-note{{variable 'x' is declared here}} expected-note{{add initialization}}
7   return x; // expected-warning{{variable 'x' is possibly uninitialized when used here}}
10 // Test ObjC fast enumeration.
11 void test2() {
12   id collection = 0;
13   for (id obj in collection) {
14     if (0 == obj) // no-warning
15       break;
16   }
19 void test3() {
20   id collection = 0;
21   id obj;
22   for (obj in collection) { // no-warning
23     if (0 == obj) // no-warning
24       break;
25   }