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
+
+@interface Foo
+- (void)method:(int)n;
+@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;
+}


        
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to