annotate clang/test/Parser/objc-at-directive-fixit.m @ 150:1d019706d866

LLVM10
author anatofuz
date Thu, 13 Feb 2020 15:10:13 +0900
parents
children c4bab56944e8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 // RUN: %clang_cc1 -fsyntax-only -triple x86_64-apple-macosx10.10.0 -verify -fobjc-exceptions %s
anatofuz
parents:
diff changeset
2 // RUN: not %clang_cc1 -fsyntax-only -triple x86_64-apple-macosx10.10.0 -fdiagnostics-parseable-fixits -fobjc-exceptions %s 2>&1 | FileCheck %s
anatofuz
parents:
diff changeset
3
anatofuz
parents:
diff changeset
4 // rdar://19669565
anatofuz
parents:
diff changeset
5
anatofuz
parents:
diff changeset
6 void bar(int x);
anatofuz
parents:
diff changeset
7
anatofuz
parents:
diff changeset
8 void f() {
anatofuz
parents:
diff changeset
9 @try { }
anatofuz
parents:
diff changeset
10 @finally { }
anatofuz
parents:
diff changeset
11 @autoreleasepool { }
anatofuz
parents:
diff changeset
12
anatofuz
parents:
diff changeset
13 // Provide a fixit when we are parsing a standalone statement
anatofuz
parents:
diff changeset
14 @tr { }; // expected-error {{unexpected '@' in program}}
anatofuz
parents:
diff changeset
15 // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:4-[[@LINE-1]]:6}:"try"
anatofuz
parents:
diff changeset
16 @finaly { }; // expected-error {{unexpected '@' in program}}
anatofuz
parents:
diff changeset
17 // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:4-[[@LINE-1]]:10}:"finally"
anatofuz
parents:
diff changeset
18 @autorelpool { }; // expected-error {{unexpected '@' in program}}
anatofuz
parents:
diff changeset
19 // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:4-[[@LINE-1]]:15}:"autoreleasepool"
anatofuz
parents:
diff changeset
20
anatofuz
parents:
diff changeset
21 // Ensure that no fixit is given when parsing expressions
anatofuz
parents:
diff changeset
22 // CHECK-NOT: fix-it
anatofuz
parents:
diff changeset
23 id thing = @autoreleasepool { }; // expected-error {{unexpected '@' in program}}
anatofuz
parents:
diff changeset
24 (void)@tr { }; // expected-error {{unexpected '@' in program}}
anatofuz
parents:
diff changeset
25 bar(@final { }); // expected-error {{unexpected '@' in program}}
anatofuz
parents:
diff changeset
26 for(@auto;;) { } // expected-error {{unexpected '@' in program}}
anatofuz
parents:
diff changeset
27 [@try]; // expected-error {{unexpected '@' in program}}
anatofuz
parents:
diff changeset
28 }