xref: /minix3/external/bsd/llvm/dist/clang/test/CodeGenObjC/encode-test-3.m (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc// RUN: %clang_cc1 -triple=i686-apple-darwin9 -emit-llvm -o - %s | FileCheck %s
2*f4a2713aSLionel Sambuc
3*f4a2713aSLionel Sambucint main() {
4*f4a2713aSLionel Sambuc  int n;
5*f4a2713aSLionel Sambuc
6*f4a2713aSLionel Sambuc  const char * inc = @encode(int[]);
7*f4a2713aSLionel Sambuc// CHECK: ^i
8*f4a2713aSLionel Sambuc// CHECK-NOT: ^i
9*f4a2713aSLionel Sambuc  const char * vla = @encode(int[n]);
10*f4a2713aSLionel Sambuc// CHECK: [0i]
11*f4a2713aSLionel Sambuc// CHECK-NOT: [0i]
12*f4a2713aSLionel Sambuc}
13*f4a2713aSLionel Sambuc
14*f4a2713aSLionel Sambuc// PR3648
15*f4a2713aSLionel Sambucint a[sizeof(@encode(int)) == 2 ? 1 : -1]; // Type is char[2]
16*f4a2713aSLionel Sambucconst char *B = @encode(int);
17*f4a2713aSLionel Sambucchar (*c)[2] = &@encode(int); // @encode is an lvalue
18*f4a2713aSLionel Sambuc
19*f4a2713aSLionel Sambucchar d[] = @encode(int);   // infer size.
20*f4a2713aSLionel Sambucchar e[1] = @encode(int);  // truncate
21*f4a2713aSLionel Sambucchar f[2] = @encode(int);  // fits
22*f4a2713aSLionel Sambucchar g[3] = @encode(int);  // zero fill
23*f4a2713aSLionel Sambuc
24