1 // RUN: %cheri_cc1 -fsyntax-only -verify %s
2 
3 struct cheri_object_wrong
4 {
5 	void * __capability a, * __capability b, * __capability c;
6 };
7 struct cheri_object_wrong2
8 {
9 	void * __capability a, * __capability b;
10 	int c;
11 };
12 
13 extern struct cheri_class def;
14 struct cheri_object_wrong def2;
15 struct cheri_object_wrong2 def3;
16 
17 
18 __attribute__((cheri_ccall))
19 __attribute__((cheri_method_class(def))) // expected-error{{must be a CHERI class}}
a(int a,int b)20 void a(int a, int b) {}
21 
22 __attribute__((cheri_ccall))
23 __attribute__((cheri_method_class(def2))) // expected-error{{must be a CHERI class}}
b(int a,int b)24 void b(int a, int b) {}
25 __attribute__((cheri_ccall))
26 __attribute__((cheri_method_class(def3))) // expected-error{{must be a CHERI class}}
c(int a,int b)27 void c(int a, int b) {}
28 __attribute__((cheri_ccall))
29 __attribute__((cheri_method_class(def4))) // expected-error{{requires a valid declaration}}
d(int a,int b)30 void d(int a, int b) {}
31