[llvm-commits] [test-suite] r128436 - in /test-suite/trunk/SingleSource/UnitTests/ObjC++: Makefile property-reference-object.mm property-reference-object.reference_output
jahanian
fjahanian at apple.com
Tue Mar 29 08:52:00 PDT 2011
On Mar 29, 2011, at 8:48 AM, Bob Wilson wrote:
> You changed the makefile to expect the executable to fail, but it's failing to compile with llvm-gcc (http://llvm.org/perf/db_default/simple/nts/149/):
>
> /nightly/src/test-suite/SingleSource/UnitTests/ObjC++/property-reference-object.mm: In function ?~@~Xobjc_object* -[TNSObject init](TNSObject*, objc_selector*)?~@~Y:
> /nightly/src/test-suite/SingleSource/UnitTests/ObjC++/property-reference-object.mm:74: error: setting a C++ non-POD object value is not implemented - assign the value to a temporary and use the temporary.
> /nightly/src/test-suite/SingleSource/UnitTests/ObjC++/property-reference-object.mm:75: error: setting a C++ non-POD object value is not implemented - assign the value to a temporary and use the temporary.
> /nightly/src/test-suite/SingleSource/UnitTests/ObjC++/property-reference-object.mm:76: error: setting a C++ non-POD object value is not implemented - assign the value to a temporary and use the temporary.
>
> Can you change it to skip this test altogether for llvm-gcc?
I though the change in Makefile does this. But how? Test has output. How do I make this clang specific when having an expected property-reference-object.reference_output
(Do I need to add fake printf's for llvm-gcc) ?
- fj
>
> On Mar 28, 2011, at 4:48 PM, Fariborz Jahanian wrote:
>
>> Author: fjahanian
>> Date: Mon Mar 28 18:48:25 2011
>> New Revision: 128436
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=128436&view=rev
>> Log:
>> This is test for clang's // rdar://9070460.
>> I have modified the Makefile so test is skipped
>> for llvm-gcc (which does not fully support this feature).
>>
>>
>> Added:
>> test-suite/trunk/SingleSource/UnitTests/ObjC++/property-reference-object.mm
>> test-suite/trunk/SingleSource/UnitTests/ObjC++/property-reference-object.reference_output
>> Modified:
>> test-suite/trunk/SingleSource/UnitTests/ObjC++/Makefile
>>
>> Modified: test-suite/trunk/SingleSource/UnitTests/ObjC++/Makefile
>> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/UnitTests/ObjC%2B%2B/Makefile?rev=128436&r1=128435&r2=128436&view=diff
>> ==============================================================================
>> --- test-suite/trunk/SingleSource/UnitTests/ObjC++/Makefile (original)
>> +++ test-suite/trunk/SingleSource/UnitTests/ObjC++/Makefile Mon Mar 28 18:48:25 2011
>> @@ -6,4 +6,10 @@
>>
>> LDFLAGS += -lstdc++ -lobjc -framework Foundation
>> PROGRAM_REQUIRED_TO_EXIT_OK := 1
>> +
>> +# This is a known gcc / llvm-gcc miscompilation fixed in clang.
>> +ifdef CC_UNDER_TEST_IS_LLVM_GCC
>> +EXEC_XFAILS = property-reference-object
>> +endif
>> +
>> include $(LEVEL)/SingleSource/Makefile.singlesrc
>>
>> Added: test-suite/trunk/SingleSource/UnitTests/ObjC++/property-reference-object.mm
>> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/UnitTests/ObjC%2B%2B/property-reference-object.mm?rev=128436&view=auto
>> ==============================================================================
>> --- test-suite/trunk/SingleSource/UnitTests/ObjC++/property-reference-object.mm (added)
>> +++ test-suite/trunk/SingleSource/UnitTests/ObjC++/property-reference-object.mm Mon Mar 28 18:48:25 2011
>> @@ -0,0 +1,105 @@
>> +#import <Foundation/Foundation.h>
>> +
>> +static int count;
>> +class Foo
>> +{
>> + static int sNextId;
>> + int mId;
>> + int mRefId;
>> +public:
>> + Foo(const Foo& rhs){
>> + mId = sNextId++;
>> + mRefId = rhs.mId;
>> + printf("Foo(%d,%d)\n", mId, mRefId);
>> + };
>> +
>> + Foo() {
>> + mId = sNextId++;
>> + mRefId = mId;
>> + printf("Foo(%d,%d)\n", mId,mRefId);
>> + }
>> + ~Foo(){
>> + printf("~Foo(%d, %d)\n", mId, mRefId);
>> + };
>> +
>> + Foo& operator=(const Foo& rhs){
>> + mRefId = rhs.mRefId;
>> + return *this;
>> + };
>> +
>> + int Data() { return fData; };
>> +
>> +private:
>> + int fData;
>> +};
>> +
>> +int Foo::sNextId = 0;
>> +
>> +
>> +#pragma mark -
>> +
>> +
>> + at interface TNSObject : NSObject
>> +{
>> + at private
>> + Foo _cppObjectNonAtomic;
>> + Foo _cppObjectAtomic;
>> + Foo _cppObjectDynamic;
>> +}
>> +
>> + at property (assign, readwrite, nonatomic) const Foo& cppObjectNonAtomic;
>> + at property (assign, readwrite) const Foo& cppObjectAtomic;
>> + at property (assign, readwrite, nonatomic) const Foo& cppObjectDynamic;
>> + at end
>> +
>> +
>> +#pragma mark -
>> +
>> +
>> + at implementation TNSObject
>> +
>> + at synthesize cppObjectNonAtomic = _cppObjectNonAtomic;
>> + at synthesize cppObjectAtomic = _cppObjectAtomic;
>> + at dynamic cppObjectDynamic;
>> +
>> +- (id)init
>> +{
>> + self = [super init];
>> + if (self) {
>> +
>> + // Add your subclass-specific initialization here.
>> + // If an error occurs here, send a [self release] message and return nil.
>> +
>> + Foo cppObject;
>> + self.cppObjectNonAtomic = cppObject;
>> + self.cppObjectAtomic = cppObject;
>> + self.cppObjectDynamic = cppObject;
>> + }
>> + return self;
>> +}
>> +
>> +- (const Foo&) cppObjectDynamic
>> +{
>> + return _cppObjectDynamic;
>> +}
>> +
>> +- (void) setCppObjectDynamic: (const Foo&)cppObject
>> +{
>> + _cppObjectDynamic = cppObject;
>> +}
>> + at end
>> +
>> +
>> +#pragma mark -
>> +
>> +
>> +int main (int argc, const char * argv[])
>> +{
>> + NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
>> +
>> + [[[TNSObject alloc] init] autorelease];
>> +
>> + [pool drain];
>> + return 0;
>> +}
>> +
>>
>> Added: test-suite/trunk/SingleSource/UnitTests/ObjC++/property-reference-object.reference_output
>> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/UnitTests/ObjC%2B%2B/property-reference-object.reference_output?rev=128436&view=auto
>> ==============================================================================
>> --- test-suite/trunk/SingleSource/UnitTests/ObjC++/property-reference-object.reference_output (added)
>> +++ test-suite/trunk/SingleSource/UnitTests/ObjC++/property-reference-object.reference_output Mon Mar 28 18:48:25 2011
>> @@ -0,0 +1,14 @@
>> +Foo(0,0)
>> +Foo(1,1)
>> +Foo(2,2)
>> +Foo(3,3)
>> +Foo(4,3)
>> +~Foo(4, 3)
>> +Foo(5,3)
>> +~Foo(5, 3)
>> +Foo(6,3)
>> +~Foo(6, 3)
>> +~Foo(3, 3)
>> +~Foo(2, 3)
>> +~Foo(1, 3)
>> +~Foo(0, 3)
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20110329/1e7fbf1b/attachment.html>
More information about the llvm-commits
mailing list