[PATCH] D90140: [clang][RecoveryExpr] Add tests for ObjectiveC.

Haojian Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 26 02:54:52 PDT 2020


hokein created this revision.
hokein added a reviewer: sammccall.
Herald added a project: clang.
hokein requested review of this revision.

to demonstrate it works for some cases.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D90140

Files:
  clang/test/AST/ast-dump-recovery.m


Index: clang/test/AST/ast-dump-recovery.m
===================================================================
--- /dev/null
+++ 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;
+}


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D90140.300610.patch
Type: text/x-patch
Size: 855 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20201026/226e7c36/attachment.bin>


More information about the cfe-commits mailing list