Skip to content
Snippets Groups Projects
Commit a441d81b authored by Daniel Dunbar's avatar Daniel Dunbar
Browse files

Merge encode-test-1.m into encode-test.m

llvm-svn: 116225
parent 32708f95
No related branches found
No related tags found
No related merge requests found
// RUN: %clang_cc1 -triple=i686-apple-darwin9 -emit-llvm -o %t %s
// RUN: grep -e "{Base=b2b3b4b5}" %t | count 1
// RUN: grep -e "{Derived=b2b3b4b5b5b4b3}" %t | count 1
enum Enum { one, two, three, four };
@interface Base {
unsigned a: 2;
int b: 3;
enum Enum c: 4;
unsigned d: 5;
}
@end
@interface Derived: Base {
signed e: 5;
int f: 4;
enum Enum g: 3;
}
@end
@implementation Base @end
@implementation Derived @end
int main(void)
{
const char *en = @encode(Base);
// printf ("%s\n", en);
const char *ed = @encode(Derived);
// printf ("%s\n", ed);
return 0;
}
......@@ -109,3 +109,32 @@ const char g4[] = @encode(const struct S);
// CHECK: @g5 = constant [12 x i8] c"^{Object=#}\00"
const char g5[] = @encode(MyObj * const);
////
enum Enum1X { one, two, three, four };
@interface Base1X {
unsigned a: 2;
int b: 3;
enum Enum1X c: 4;
unsigned d: 5;
}
@end
@interface Derived1X: Base1X {
signed e: 5;
int f: 4;
enum Enum1X g: 3;
}
@end
@implementation Base1X @end
@implementation Derived1X @end
// CHECK: @g6 = constant [18 x i8] c"{Base1X=b2b3b4b5}\00"
const char g6[] = @encode(Base1X);
// CHECK: @g7 = constant [27 x i8] c"{Derived1X=b2b3b4b5b5b4b3}\00"
const char g7[] = @encode(Derived1X);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment