[cfe-commits] r156485 - in /cfe/trunk/test/Index: boxed-exprs.h boxed-exprs.m

Argyrios Kyrtzidis akyrtzi at gmail.com
Wed May 9 10:46:47 PDT 2012


Author: akirtzidis
Date: Wed May  9 12:46:47 2012
New Revision: 156485

URL: http://llvm.org/viewvc/llvm-project?rev=156485&view=rev
Log:
[libclang] Add a test for objc boxed expressions.

rdar://11407754

Added:
    cfe/trunk/test/Index/boxed-exprs.h
    cfe/trunk/test/Index/boxed-exprs.m

Added: cfe/trunk/test/Index/boxed-exprs.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/boxed-exprs.h?rev=156485&view=auto
==============================================================================
--- cfe/trunk/test/Index/boxed-exprs.h (added)
+++ cfe/trunk/test/Index/boxed-exprs.h Wed May  9 12:46:47 2012
@@ -0,0 +1,10 @@
+
+ at interface NSString @end
+
+ at interface NSString (NSStringExtensionMethods)
++ (id)stringWithUTF8String:(const char *)nullTerminatedCString;
+ at end
+
+static inline void infoo(const char *cs) {
+  NSString *s = @(cs);
+}

Added: cfe/trunk/test/Index/boxed-exprs.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/boxed-exprs.m?rev=156485&view=auto
==============================================================================
--- cfe/trunk/test/Index/boxed-exprs.m (added)
+++ cfe/trunk/test/Index/boxed-exprs.m Wed May  9 12:46:47 2012
@@ -0,0 +1,19 @@
+
+#include "boxed-exprs.h"
+
+const char *glob_str;
+
+void foo() {
+  NSString *s = @(glob_str);
+}
+
+// RUN: c-index-test -index-file -target x86_64-apple-macosx10.7 %s | FileCheck -check-prefix=CHECK-INDEX %s
+// CHECK-INDEX: [indexEntityReference]: kind: variable | name: glob_str | {{.*}} | loc: 7:19
+
+// RUN: c-index-test -cursor-at=%s:7:24 -target x86_64-apple-macosx10.7 %s | FileCheck -check-prefix=CHECK-CURSOR %s
+// RUN: env CINDEXTEST_EDITING=1 c-index-test -cursor-at=%s:7:24 -target x86_64-apple-macosx10.7 %s | FileCheck -check-prefix=CHECK-CURSOR %s
+// CHECK-CURSOR: 7:19 DeclRefExpr=glob_str:4:13 Extent=[7:19 - 7:27] Spelling=glob_str ([7:19 - 7:27])
+
+// RUN: c-index-test -cursor-at=%S/boxed-exprs.h:9:19 -target x86_64-apple-macosx10.7 %s | FileCheck -check-prefix=CHECK-CURSOR2 %s
+// RUN: env CINDEXTEST_EDITING=1 c-index-test -cursor-at=%S/boxed-exprs.h:9:19 -target x86_64-apple-macosx10.7 %s | FileCheck -check-prefix=CHECK-CURSOR2 %s
+// CHECK-CURSOR2: 9:19 DeclRefExpr=cs:8:38 Extent=[9:19 - 9:21] Spelling=cs ([9:19 - 9:21])





More information about the cfe-commits mailing list