Mercurial > hg > CbC > CbC_gcc
view gcc/testsuite/objc/execute/initialize-1.m @ 158:494b0b89df80 default tip
...
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 25 May 2020 18:13:55 +0900 |
parents | 04ced10e8804 |
children |
line wrap: on
line source
/* Contributed by Nicola Pero - Sat 8 Oct 2011 16:47:48 BST */ #include <objc/objc.h> /* Test that if a class has no +initialize method, the superclass implementation is called. */ static int class_variable = 0; @interface TestClass { Class isa; } + (void) initialize; + (int) classVariable; @end @implementation TestClass + (void) initialize { class_variable++; } + (int) classVariable { return class_variable; } @end @interface TestSubClass : TestClass @end @implementation TestSubClass @end int main (void) { if ([TestClass classVariable] != 1) { abort (); } if ([TestSubClass classVariable] != 2) { abort (); } return 0; }