aboutsummaryrefslogtreecommitdiff
path: root/clang/test/CodeGenObjC/ivar-layout-flexible-array.m
blob: 8727ff19a7d1e3f558b9dfb2a9fe5b3e6402e245 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// RUN: %clang_cc1 -triple x86_64-apple-darwin -Wno-objc-root-class -fobjc-arc -emit-llvm -o - %s | FileCheck %s

@interface FlexibleArrayMember {
  char flexible_array[][4][2];
}
@end
@implementation FlexibleArrayMember
@end
// CHECK: @OBJC_METH_VAR_NAME_{{.*}} = private unnamed_addr constant {{.*}} c"flexible_array\00"
// CHECK-NEXT: @OBJC_METH_VAR_TYPE_{{.*}} = private unnamed_addr constant {{.*}} c"^[4[2c]]\00"


typedef char FlexibleArray[];

struct Packet {
  int size;
  FlexibleArray data;
};

@interface VariableSizeIvar {
  struct Packet flexible_struct;
}
@end
@implementation VariableSizeIvar
@end
// CHECK: @OBJC_METH_VAR_NAME_{{.*}} = private unnamed_addr constant {{.*}} c"flexible_struct\00"
// CHECK-NEXT: @OBJC_METH_VAR_TYPE_{{.*}} = private unnamed_addr constant {{.*}} c"{Packet=\22size\22i\22data\22[0c]}\00"