[llvm-commits] [llvm-gcc-4.2] r100334 - /llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/property-getter-codegen.mm
Evan Cheng
evan.cheng at apple.com
Sun Apr 4 11:03:52 PDT 2010
Author: evancheng
Date: Sun Apr 4 13:03:52 2010
New Revision: 100334
URL: http://llvm.org/viewvc/llvm-project?rev=100334&view=rev
Log:
Untabify.
Modified:
llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/property-getter-codegen.mm
Modified: llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/property-getter-codegen.mm
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/obj-c%2B%2B.dg/property-getter-codegen.mm?rev=100334&r1=100333&r2=100334&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/property-getter-codegen.mm (original)
+++ llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/property-getter-codegen.mm Sun Apr 4 13:03:52 2010
@@ -12,54 +12,54 @@
class Vector3D
{
- public:
- float x, y, z;
-
- public:
- Vector3D();
- Vector3D(const Vector3D &inVector);
- Vector3D(float initX, float initY, float initZ);
- Vector3D &operator=(const Vector3D & rhs);
-
- NSString *description();
+ public:
+ float x, y, z;
+
+ public:
+ Vector3D();
+ Vector3D(const Vector3D &inVector);
+ Vector3D(float initX, float initY, float initZ);
+ Vector3D &operator=(const Vector3D & rhs);
+
+ NSString *description();
};
Vector3D::Vector3D()
{
- x = y = z = 0;
+ x = y = z = 0;
}
Vector3D::Vector3D(const Vector3D &inVector)
{
- x = inVector.x;
- y = inVector.y;
- z = inVector.z;
+ x = inVector.x;
+ y = inVector.y;
+ z = inVector.z;
}
Vector3D::Vector3D(float initX, float initY, float initZ)
{
- x = initX;
- y = initY;
- z = initZ;
+ x = initX;
+ y = initY;
+ z = initZ;
}
Vector3D &Vector3D::operator=(const Vector3D & rhs)
{
- x = rhs.x;
- y = rhs.y;
- z = rhs.z;
-
- return *this;
+ x = rhs.x;
+ y = rhs.y;
+ z = rhs.z;
+
+ return *this;
}
NSString *Vector3D::description()
{
- return [NSString stringWithFormat: @"(%f, %f, %f)", x, y, z];
+ return [NSString stringWithFormat: @"(%f, %f, %f)", x, y, z];
}
@interface Object3D : NSObject
{
- Vector3D position;
+ Vector3D position;
}
@property (assign) Vector3D position;
@@ -73,47 +73,47 @@
- (id) init
{
- self = [super init];
- if(self)
- {
- position = Vector3D(0, 0, 0);
- }
-
- return self;
+ self = [super init];
+ if(self)
+ {
+ position = Vector3D(0, 0, 0);
+ }
+
+ return self;
}
- (void) setPosition: (Vector3D) inPosition
{
- position = inPosition;
- NSLog(@"setPosition was called with the vector %@", inPosition.description());
- ++count;
+ position = inPosition;
+ NSLog(@"setPosition was called with the vector %@", inPosition.description());
+ ++count;
}
@end
int main (int argc, const char * argv[])
{
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- Object3D *myObject = [[Object3D alloc] init];
-
- // Each of these looks like it should call the setPosition method. However,
- // if the Vector3D copy constructor is defined, this one won't.
+ Object3D *myObject = [[Object3D alloc] init];
+
+ // Each of these looks like it should call the setPosition method. However,
+ // if the Vector3D copy constructor is defined, this one won't.
// APPLE LOCAL begin radar 7591784
// Workaround for bug in radar 7591784
Vector3D V3D(1.0f, 1.0f, 1.0f);
- myObject.position = V3D;
+ myObject.position = V3D;
// APPLE LOCAL end radar 7591784
- NSLog(@"After assignment the position is: %@", myObject.position.description());
+ NSLog(@"After assignment the position is: %@", myObject.position.description());
- [myObject setPosition: Vector3D(2.0f, 2.0f, 2.0f)];
- NSLog(@"After setPosition: the position is: %@", myObject.position.description());
+ [myObject setPosition: Vector3D(2.0f, 2.0f, 2.0f)];
+ NSLog(@"After setPosition: the position is: %@", myObject.position.description());
- typedef void (*SetPositionIMP)(id self, SEL _cmd, Vector3D position);
- ((SetPositionIMP)objc_msgSend)(myObject, @selector(setPosition:), Vector3D(3.0f, 3.0f, 3.0f));
- NSLog(@"After objc_msgSend the position is: %@", myObject.position.description());
+ typedef void (*SetPositionIMP)(id self, SEL _cmd, Vector3D position);
+ ((SetPositionIMP)objc_msgSend)(myObject, @selector(setPosition:), Vector3D(3.0f, 3.0f, 3.0f));
+ NSLog(@"After objc_msgSend the position is: %@", myObject.position.description());
- [pool release];
+ [pool release];
if (count != 3)
- abort();
+ abort();
return 0;
}
More information about the llvm-commits
mailing list