phunix/external/bsd/llvm/dist/clang/test/ARCMT/objcmt-designated-initializer.m
Lionel Sambuc 0a6a1f1d05 NetBSD re-synchronization of the source tree
This brings our tree to NetBSD 7.0, as found on -current on the
10-10-2015.

This updates:
 - LLVM to 3.6.1
 - GCC to GCC 5.1
 - Replace minix/commands/zdump with usr.bin/zdump
 - external/bsd/libelf has moved to /external/bsd/elftoolchain/
 - Import ctwm
 - Drop sprintf from libminc

Change-Id: I149836ac18e9326be9353958bab9b266efb056f0
2016-01-13 20:32:14 +01:00

45 lines
804 B
Objective-C

// RUN: rm -rf %t
// RUN: %clang_cc1 -objcmt-migrate-designated-init %s -triple x86_64-apple-darwin11 -fobjc-arc -migrate -o %t.remap
// RUN: c-arcmt-test %t.remap | arcmt-test -verify-transformed-files %s.result
// RUN: %clang_cc1 -triple x86_64-apple-darwin11 -fsyntax-only -x objective-c -fobjc-arc %s.result
#define NS_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer))
@class NSString;
@interface B1
-(id)init;
@end
@interface S1 : B1
-(id)initWithFoo:(NSString*)foo;
@end
@implementation S1
-(id)initWithFoo:(NSString*)foo
{
self = [super init];
if (self) {
}
return self;
}
@end
@interface B2
-(id)init NS_DESIGNATED_INITIALIZER;
@end
@interface S2 : B2
-(id)init;
@end
@implementation S2
-(id)init
{
self = [super init];
if (self) {
}
return self;
}
@end