diff options
author | rdivacky <rdivacky@FreeBSD.org> | 2010-03-03 17:28:16 +0000 |
---|---|---|
committer | rdivacky <rdivacky@FreeBSD.org> | 2010-03-03 17:28:16 +0000 |
commit | df90325d4c0a65ee64d2dae3ed9b5b34f7418533 (patch) | |
tree | e1a885aadfd80632f5bd70d4bd2d37e715e35a79 /test/ASTMerge/Inputs | |
parent | fd035e6496665b1f1197868e21cb0a4594e8db6e (diff) | |
download | FreeBSD-src-df90325d4c0a65ee64d2dae3ed9b5b34f7418533.zip FreeBSD-src-df90325d4c0a65ee64d2dae3ed9b5b34f7418533.tar.gz |
Update clang to 97654.
Diffstat (limited to 'test/ASTMerge/Inputs')
-rw-r--r-- | test/ASTMerge/Inputs/category1.m | 25 | ||||
-rw-r--r-- | test/ASTMerge/Inputs/category2.m | 27 | ||||
-rw-r--r-- | test/ASTMerge/Inputs/exprs1.c | 10 | ||||
-rw-r--r-- | test/ASTMerge/Inputs/exprs2.c | 10 | ||||
-rw-r--r-- | test/ASTMerge/Inputs/interface1.m | 78 | ||||
-rw-r--r-- | test/ASTMerge/Inputs/interface2.m | 77 | ||||
-rw-r--r-- | test/ASTMerge/Inputs/namespace1.cpp | 17 | ||||
-rw-r--r-- | test/ASTMerge/Inputs/namespace2.cpp | 17 | ||||
-rw-r--r-- | test/ASTMerge/Inputs/property1.m | 12 | ||||
-rw-r--r-- | test/ASTMerge/Inputs/property2.m | 13 |
10 files changed, 282 insertions, 4 deletions
diff --git a/test/ASTMerge/Inputs/category1.m b/test/ASTMerge/Inputs/category1.m new file mode 100644 index 0000000..ade1c6c --- /dev/null +++ b/test/ASTMerge/Inputs/category1.m @@ -0,0 +1,25 @@ +@interface I1 +@end + +// Matching category +@interface I1 (Cat1) +- (int)method0; +@end + +// Matching class extension +@interface I1 () +- (int)method1; +@end + +// Mismatched category +@interface I1 (Cat2) +- (int)method2; +@end + +@interface I2 +@end + +// Mismatched class extension +@interface I2 () +- (int)method3; +@end diff --git a/test/ASTMerge/Inputs/category2.m b/test/ASTMerge/Inputs/category2.m new file mode 100644 index 0000000..f66c208 --- /dev/null +++ b/test/ASTMerge/Inputs/category2.m @@ -0,0 +1,27 @@ +typedef int Int; + +@interface I1 +@end + +// Matching category +@interface I1 (Cat1) +- (Int)method0; +@end + +// Matching class extension +@interface I1 () +- (Int)method1; +@end + +// Mismatched category +@interface I1 (Cat2) +- (float)method2; +@end + +@interface I2 +@end + +// Mismatched class extension +@interface I2 () +- (float)method3; +@end diff --git a/test/ASTMerge/Inputs/exprs1.c b/test/ASTMerge/Inputs/exprs1.c new file mode 100644 index 0000000..1c268da --- /dev/null +++ b/test/ASTMerge/Inputs/exprs1.c @@ -0,0 +1,10 @@ +// Matching +enum E0 { + E0_Val0 = 'a', + E0_Val1 = (17), + E0_Val2 = (1 << 2), + E0_Val3 = E0_Val2, + E0_Val4 = sizeof(int*), + E0_Val5 = (unsigned int)-1 +}; + diff --git a/test/ASTMerge/Inputs/exprs2.c b/test/ASTMerge/Inputs/exprs2.c new file mode 100644 index 0000000..1c268da --- /dev/null +++ b/test/ASTMerge/Inputs/exprs2.c @@ -0,0 +1,10 @@ +// Matching +enum E0 { + E0_Val0 = 'a', + E0_Val1 = (17), + E0_Val2 = (1 << 2), + E0_Val3 = E0_Val2, + E0_Val4 = sizeof(int*), + E0_Val5 = (unsigned int)-1 +}; + diff --git a/test/ASTMerge/Inputs/interface1.m b/test/ASTMerge/Inputs/interface1.m index 1aa1c3b..7e9935d 100644 --- a/test/ASTMerge/Inputs/interface1.m +++ b/test/ASTMerge/Inputs/interface1.m @@ -1,7 +1,81 @@ // Matches -@interface I1 +@interface I1 { + int ivar1; +} @end // Matches -@interface I2 : I1 +@interface I2 : I1 { + float ivar2; +} +@end + +// Ivar mismatch +@interface I3 { + int ivar1; + int ivar2; +} +@end + +// Superclass mismatch +@interface I4 : I2 { +} +@end + +// Methods match +@interface I5 +- (int)foo; ++ (float)bar; +@end + +// Method mismatch +@interface I6 +- (int)foo; ++ (int)foo; +@end + +// Method mismatch +@interface I7 +- (int)foo; ++ (int)bar:(int)x; +@end + +// Method mismatch +@interface I8 +- (int)foo; ++ (int)bar:(float)x; +@end + +// Matching protocol +@protocol P0 ++ (int)foo; +- (int)bar:(float)x; +@end + +// Protocol with mismatching method +@protocol P1 ++ (int)foo; +- (int)bar:(float)x; +@end + +// Interface with protocol +@interface I9 <P0> ++ (int)foo; +- (int)bar:(float)x; +@end + +// Protocol with protocol +@protocol P2 <P0> +- (float)wibble:(int)a1 second:(int)a2; +@end + +// Forward-declared interfaces +@class I10, I11; +@interface I12 +@end + +// Forward-declared protocols +@protocol P3, P5; +@protocol P4 +- (double)honk:(int)a; @end diff --git a/test/ASTMerge/Inputs/interface2.m b/test/ASTMerge/Inputs/interface2.m index 1aa1c3b..bef7fb8 100644 --- a/test/ASTMerge/Inputs/interface2.m +++ b/test/ASTMerge/Inputs/interface2.m @@ -1,7 +1,80 @@ // Matches -@interface I1 +@interface I1 { + int ivar1; +} @end // Matches -@interface I2 : I1 +@interface I2 : I1 { + float ivar2; +} +@end + +// Ivar mismatch +@interface I3 { + int ivar1; + float ivar2; +} +@end + +// Superclass mismatch +@interface I4 : I1 { +} +@end + +// Methods match +@interface I5 ++ (float)bar; +- (int)foo; +@end + +// Method mismatch +@interface I6 ++ (float)foo; +@end + +// Method mismatch +@interface I7 +- (int)foo; ++ (int)bar:(float)x; +@end + +// Method mismatch +@interface I8 +- (int)foo; ++ (int)bar:(float)x, ...; +@end + +// Matching protocol +@protocol P0 ++ (int)foo; +- (int)bar:(float)x; +@end + +// Protocol with mismatching method +@protocol P1 ++ (int)foo; +- (int)bar:(double)x; +@end + +// Interface with protocol +@interface I9 <P0> ++ (int)foo; +- (int)bar:(float)x; +@end + +// Protocol with protocol +@protocol P2 <P0> +- (float)wibble:(int)a1 second:(int)a2; +@end + +// Forward-declared interface +@class I12, I10; +@interface I11 +@end + +// Forward-declared protocols +@protocol P3, P4; +@protocol P5 +- (double)honk:(int)a; @end diff --git a/test/ASTMerge/Inputs/namespace1.cpp b/test/ASTMerge/Inputs/namespace1.cpp new file mode 100644 index 0000000..1ff84f31 --- /dev/null +++ b/test/ASTMerge/Inputs/namespace1.cpp @@ -0,0 +1,17 @@ +// Merge success +namespace N1 { + int x; +} + +// Merge multiple namespaces +namespace N2 { + extern int x; +} +namespace N2 { + extern float y; +} + +// Merge namespace with conflict +namespace N3 { + extern float z; +} diff --git a/test/ASTMerge/Inputs/namespace2.cpp b/test/ASTMerge/Inputs/namespace2.cpp new file mode 100644 index 0000000..80429f7 --- /dev/null +++ b/test/ASTMerge/Inputs/namespace2.cpp @@ -0,0 +1,17 @@ +// Merge success +namespace N1 { + extern int x0; +} + +// Merge multiple namespaces +namespace N2 { + extern int x; +} +namespace N2 { + extern float y; +} + +// Merge namespace with conflict +namespace N3 { + extern double z; +} diff --git a/test/ASTMerge/Inputs/property1.m b/test/ASTMerge/Inputs/property1.m new file mode 100644 index 0000000..37887a3 --- /dev/null +++ b/test/ASTMerge/Inputs/property1.m @@ -0,0 +1,12 @@ +// Matching properties +@interface I1 { +} +- (int)getProp2; +- (void)setProp2:(int)value; +@end + +// Mismatched property +@interface I2 +@property (readonly) float Prop1; +@end + diff --git a/test/ASTMerge/Inputs/property2.m b/test/ASTMerge/Inputs/property2.m new file mode 100644 index 0000000..6039f10 --- /dev/null +++ b/test/ASTMerge/Inputs/property2.m @@ -0,0 +1,13 @@ +// Matching properties +@interface I1 { +} +- (int)getProp2; +- (void)setProp2:(int)value; +@property (readonly) int Prop1; +@property (getter = getProp2, setter = setProp2:) int Prop2; +@end + +// Mismatched property +@interface I2 +@property (readonly) int Prop1; +@end |