Driver: tweak handling of '--analyze' to invoke
[clang.git] / test / Sema / block-args.c
blob970c60d51ddb8a43af57d97ade712ea834f4a2b7
1 // RUN: %clang_cc1 %s -fsyntax-only -verify -fblocks
3 void take(void*);
5 void test() {
6 take(^(int x){});
7 take(^(int x, int y){});
8 take(^(int x, int y){});
9 take(^(int x, // expected-note {{previous declaration is here}}
10 int x){}); // expected-error {{redefinition of parameter 'x'}}
13 take(^(int x) { return x+1; });
15 int (^CP)(int) = ^(int x) { return x*x; };
16 take(CP);
18 int arg;
19 ^{return 1;}();
20 ^{return 2;}(arg); // expected-error {{too many arguments to block call}}
21 ^(void){return 3;}(1); // expected-error {{too many arguments to block call}}
22 ^(){return 4;}(arg); // expected-error {{too many arguments to block call}}
23 ^(int x, ...){return 5;}(arg, arg); // Explicit varargs, ok.
26 int main(int argc, char** argv) {
27 ^(int argCount) {
28 argCount = 3;
29 }(argc);
32 // radar 7528255
33 void f0() {
34 ^(int, double d, char) {}(1, 1.34, 'a'); // expected-error {{parameter name omitted}} \
35 // expected-error {{parameter name omitted}}