xref: /minix3/external/bsd/llvm/dist/clang/test/SemaObjC/transparent-union.m (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc// RUN: %clang_cc1  -fsyntax-only -verify -Wno-objc-root-class %s
2*f4a2713aSLionel Sambuc// expected-no-diagnostics
3*f4a2713aSLionel Sambuc
4*f4a2713aSLionel Sambuctypedef union {
5*f4a2713aSLionel Sambuc struct xx_object_s *_do;
6*f4a2713aSLionel Sambuc struct xx_continuation_s *_dc;
7*f4a2713aSLionel Sambuc struct xx_queue_s *_dq;
8*f4a2713aSLionel Sambuc struct xx_queue_attr_s *_dqa;
9*f4a2713aSLionel Sambuc struct xx_group_s *_dg;
10*f4a2713aSLionel Sambuc struct xx_source_s *_ds;
11*f4a2713aSLionel Sambuc struct xx_source_attr_s *_dsa;
12*f4a2713aSLionel Sambuc struct xx_semaphore_s *_dsema;
13*f4a2713aSLionel Sambuc} xx_object_t __attribute__((transparent_union));
14*f4a2713aSLionel Sambuc
15*f4a2713aSLionel Sambuc@interface INTF
16*f4a2713aSLionel Sambuc- (void) doSomething : (xx_object_t) xxObject;
17*f4a2713aSLionel Sambuc- (void)testMeth;
18*f4a2713aSLionel Sambuc@end
19*f4a2713aSLionel Sambuc
20*f4a2713aSLionel Sambuc@implementation INTF
21*f4a2713aSLionel Sambuc- (void) doSomething : (xx_object_t) xxObject {}
22*f4a2713aSLionel Sambuc- (void)testMeth { struct xx_queue_s *sq; [self doSomething:sq ]; }
23*f4a2713aSLionel Sambuc@end
24