summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorHans Wennborg <hans@hanshq.net>2017-01-31 17:27:07 +0000
committerHans Wennborg <hans@hanshq.net>2017-01-31 17:27:07 +0000
commit1b8468f0151f4ed390f7b8e139fc502425d086f7 (patch)
treeaa27326a7ffba766cb13d86a3c39a1475501e017 /test
parent7bf54fb33971d145af18ce1ed4b7344df1d8a26f (diff)
Merging r293596:
------------------------------------------------------------------------ r293596 | ahatanak | 2017-01-30 18:31:39 -0800 (Mon, 30 Jan 2017) | 7 lines Handle ObjCEncodeExpr in extractStringLiteralCharacter. This fixes an assertion failure that occurs later in the function when an ObjCEncodeExpr is cast to StringLiteral. rdar://problem/30111207 ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_40@293653 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/CodeGenObjC/encode-test.m11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/CodeGenObjC/encode-test.m b/test/CodeGenObjC/encode-test.m
index 7f0e76fc3f..a1f88e0525 100644
--- a/test/CodeGenObjC/encode-test.m
+++ b/test/CodeGenObjC/encode-test.m
@@ -180,3 +180,14 @@ const char g14[] = @encode(__typeof__(*test_id));
// CHECK: @g15 = constant [2 x i8] c":\00"
const char g15[] = @encode(SEL);
+
+typedef typeof(sizeof(int)) size_t;
+size_t strlen(const char *s);
+
+// CHECK-LABEL: @test_strlen(
+// CHECK: %[[i:.*]] = alloca i32
+// CHECK: store i32 1, i32* %[[i]]
+void test_strlen() {
+ const char array[] = @encode(int);
+ int i = strlen(array);
+}