1 // RUN: %clang_cc1 -fsyntax-only -verify %s
3 #define PLACE_IN_TCB(NAME) __attribute__((enforce_tcb(NAME)))
4 #define PLACE_IN_TCB_LEAF(NAME) __attribute__((enforce_tcb_leaf(NAME)))
6 __attribute__((objc_root_class))
8 @property(readonly) id propertyNotInAnyTCB;
11 @implementation AClass
12 - (void)inTCBFoo PLACE_IN_TCB("foo") {
13 [self notInAnyTCB]; // expected-warning{{calling 'notInAnyTCB' is a violation of trusted computing base 'foo'}}
15 - (void)inTCBFooAsLeaf PLACE_IN_TCB_LEAF("foo") {
16 [self notInAnyTCB]; // no-warning
20 + (void)classMethodNotInAnyTCB {
22 + (void)classMethodInTCBFoo PLACE_IN_TCB("foo") {
23 [self inTCBFoo]; // no-warning
24 [self inTCBFooAsLeaf]; // no-warning
25 [self notInAnyTCB]; // expected-warning{{calling 'notInAnyTCB' is a violation of trusted computing base 'foo'}}
30 void call_objc_method(AClass *object) {
31 [object inTCBFoo]; // no-warning
32 [object inTCBFooAsLeaf]; // no-warning
33 [object notInAnyTCB]; // expected-warning{{calling 'notInAnyTCB' is a violation of trusted computing base 'foo'}}
34 [AClass classMethodNotInAnyTCB]; // expected-warning{{calling 'classMethodNotInAnyTCB' is a violation of trusted computing base 'foo'}}
35 [AClass classMethodInTCBFoo]; // no-warning
36 (void)object.propertyNotInAnyTCB; // expected-warning{{calling 'propertyNotInAnyTCB' is a violation of trusted computing base 'foo'}}