[clang] 2c2dc7c - [clang][RecoveryExpr] Add tests for ObjectiveC.
Haojian Wu via cfe-commits
cfe-commits at lists.llvm.org
Tue Oct 27 01:43:31 PDT 2020
Author: Haojian Wu
Date: 2020-10-27T09:42:19+01:00
New Revision: 2c2dc7c392a3f28d4dbec3018e3137d5d4f8c6c8
URL: https://github.com/llvm/llvm-project/commit/2c2dc7c392a3f28d4dbec3018e3137d5d4f8c6c8
DIFF: https://github.com/llvm/llvm-project/commit/2c2dc7c392a3f28d4dbec3018e3137d5d4f8c6c8.diff
LOG: [clang][RecoveryExpr] Add tests for ObjectiveC.
to demonstrate it works for some cases.
Differential Revision: https://reviews.llvm.org/D90140
Added:
clang/test/AST/ast-dump-recovery.m
Modified:
Removed:
################################################################################
diff --git a/clang/test/AST/ast-dump-recovery.m b/clang/test/AST/ast-dump-recovery.m
new file mode 100644
index 000000000000..5ca866a0282f
--- /dev/null
+++ b/clang/test/AST/ast-dump-recovery.m
@@ -0,0 +1,18 @@
+// RUN: not %clang_cc1 -triple x86_64-unknown-unknown -frecovery-ast -frecovery-ast-type -ast-dump %s | FileCheck -strict-whitespace %s
+
+ at interface Foo
+- (void)method:(int)n;
+ at end
+
+void k(Foo *foo) {
+ // CHECK: ObjCMessageExpr {{.*}} 'void' contains-errors
+ // CHECK-CHECK: |-ImplicitCastExpr {{.*}} 'Foo *' <LValueToRValue>
+ // CHECK-CHECK: | `-DeclRefExpr {{.*}} 'foo'
+ // CHECK-CHECK: `-RecoveryExpr {{.*}}
+ [foo method:undef];
+
+ // CHECK: ImplicitCastExpr {{.*}} '<dependent type>' contains-errors
+ // CHECK-NEXT: `-RecoveryExpr {{.*}} '<dependent type>' contains-errors
+ // CHECK-NEXT: `-DeclRefExpr {{.*}} 'foo'
+ foo.undef;
+}
More information about the cfe-commits
mailing list