diff options
Diffstat (limited to 'test/CodeGenObjC')
-rw-r--r-- | test/CodeGenObjC/block-ptr-type-crash.m | 28 | ||||
-rw-r--r-- | test/CodeGenObjC/encode-test.m | 11 |
2 files changed, 39 insertions, 0 deletions
diff --git a/test/CodeGenObjC/block-ptr-type-crash.m b/test/CodeGenObjC/block-ptr-type-crash.m new file mode 100644 index 000000000000..385d64585897 --- /dev/null +++ b/test/CodeGenObjC/block-ptr-type-crash.m @@ -0,0 +1,28 @@ +// RUN: %clang_cc1 -Wno-objc-root-class -fblocks -o /dev/null -triple x86_64-- -emit-llvm %s +// REQUIRES: asserts +// Verify there is no assertion. + +// rdar://30111891 + +typedef unsigned long long uint64_t; +typedef enum AnEnum : uint64_t AnEnum; +enum AnEnum: uint64_t { + AnEnumA +}; + +typedef void (^BlockType)(); +@interface MyClass +@end +@implementation MyClass +- (void)_doStuff { + struct { + int identifier; + AnEnum type; + BlockType handler; + } var = { + "hello", + AnEnumA, + ((void *)0) + }; +} +@end diff --git a/test/CodeGenObjC/encode-test.m b/test/CodeGenObjC/encode-test.m index 7f0e76fc3ffd..a1f88e05250a 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); +} |