2010-03-10 12:54:39 +08:00
|
|
|
// RUN: %clang_cc1 %s -fsyntax-only -fblocks -verify -Wno-unreachable-code
|
2009-02-18 12:38:20 +08:00
|
|
|
|
|
|
|
// rdar://6597252
|
2009-02-19 01:49:48 +08:00
|
|
|
Class test1(Class X) {
|
2009-02-18 12:38:20 +08:00
|
|
|
return 1 ? X : X;
|
|
|
|
}
|
|
|
|
|
2009-02-19 01:49:48 +08:00
|
|
|
|
|
|
|
// rdar://6079877
|
|
|
|
void test2() {
|
|
|
|
id str = @"foo"
|
|
|
|
"bar\0" // expected-warning {{literal contains NUL character}}
|
|
|
|
@"baz" " blarg";
|
|
|
|
id str2 = @"foo"
|
|
|
|
"bar"
|
|
|
|
@"baz"
|
|
|
|
" b\0larg"; // expected-warning {{literal contains NUL character}}
|
2009-04-04 05:11:28 +08:00
|
|
|
|
2009-02-19 01:49:48 +08:00
|
|
|
|
2009-04-04 05:11:28 +08:00
|
|
|
if (@encode(int) == "foo") { } // expected-warning {{result of comparison against @encode is unspecified}}
|
2009-03-24 10:24:46 +08:00
|
|
|
}
|
2010-03-10 12:54:39 +08:00
|
|
|
|
|
|
|
#define MAX(A,B) ({ __typeof__(A) __a = (A); __typeof__(B) __b = (B); __a < __b ? __b : __a; })
|
|
|
|
void (^foo)(int, int) = ^(int x, int y) { int z = MAX(x, y); };
|