1/* Test whether including C++ keywords such as 'and', 'or', 2 'not', etc., is allowed inside ObjC selectors (as it must be). */ 3/* Author: Ziemowit Laski <zlaski@apple.com>. */ 4 5/* { dg-do compile } */ 6// { dg-additional-options "-Wno-objc-root-class" } 7 8@interface Int1 9+ (int)and_eq:(int)arg1 and:(int)arg2; 10- (int)or_eq:(int)arg1 or:(int)arg3; 11- (int)not:(int)arg1 xor:(int)arg2; 12- (void)bitand:(char)c1 bitor:(char)c2; 13- (void)compl:(float)f1 xor_eq:(double)d1; 14- (void)not_eq; 15@end 16 17@implementation Int1 18+ (int)and_eq:(int)arg1 and:(int)arg2 { return arg1 + arg2; } 19- (int)or_eq:(int)arg1 or:(int)arg3 { return arg1 + arg3; } 20- (int)not:(int)arg1 xor:(int)arg2 { return arg1 + arg2; } 21- (void)bitand:(char)c1 bitor:(char)c2 { } 22- (void)compl:(float)f1 xor_eq:(double)d1 { } 23- (void)not_eq { } 24@end 25 26/* { dg-final { scan-assembler "\\+\\\[Int1 and_eq:and:\\]|c_Int1__and_eq_and" } } */ 27/* { dg-final { scan-assembler "\\-\\\[Int1 or_eq:or:\\]|i_Int1__or_eq_or" } } */ 28/* { dg-final { scan-assembler "\\-\\\[Int1 not:xor:\\]|i_Int1__not_xor" } } */ 29/* { dg-final { scan-assembler "\\-\\\[Int1 bitand:bitor:\\]|i_Int1__bitand_bitor" } } */ 30/* { dg-final { scan-assembler "\\-\\\[Int1 compl:xor_eq:\\]|i_Int1__compl_xor_eq" } } */ 31/* { dg-final { scan-assembler "\\-\\\[Int1 not_eq\\]|i_Int1__not_eq" } } */ 32