blob: e3b2c1ab7a7d38d90dfcb6f820c7ead5739c0229 [file] [log] [blame]
Argyrios Kyrtzidisfe04fe02013-10-07 16:38:40 +00001// RUN: c-index-test -test-load-source all %s | FileCheck %s
2
3struct __attribute__((packed)) Test2 {
4 char a;
5};
6
Joey Gouly81228382014-05-01 15:41:58 +00007void pure_fn() __attribute__((pure));
8void const_fn() __attribute__((const));
9void noduplicate_fn() __attribute__((noduplicate));
10
Michael Wu58d837d2018-08-03 05:55:40 +000011enum __attribute((flag_enum)) FlagEnum {
12 Foo
13};
14
Argyrios Kyrtzidisfe04fe02013-10-07 16:38:40 +000015// CHECK: attributes.c:3:32: StructDecl=Test2:3:32 (Definition) Extent=[3:1 - 5:2]
16// CHECK: attributes.c:3:23: attribute(packed)=packed Extent=[3:23 - 3:29]
17// CHECK: attributes.c:4:8: FieldDecl=a:4:8 (Definition) Extent=[4:3 - 4:9] [access=public]
18
Joey Gouly81228382014-05-01 15:41:58 +000019// CHECK: attributes.c:7:6: FunctionDecl=pure_fn:7:6 Extent=[7:1 - 7:37]
20// CHECK: attributes.c:7:31: attribute(pure)= Extent=[7:31 - 7:35]
21// CHECK: attributes.c:8:6: FunctionDecl=const_fn:8:6 Extent=[8:1 - 8:39]
22// CHECK: attributes.c:8:32: attribute(const)= Extent=[8:32 - 8:37]
23// CHECK: attributes.c:9:6: FunctionDecl=noduplicate_fn:9:6 Extent=[9:1 - 9:51]
24// CHECK: attributes.c:9:38: attribute(noduplicate)= Extent=[9:38 - 9:49]
Michael Wu58d837d2018-08-03 05:55:40 +000025// CHECK: attributes.c:11:31: EnumDecl=FlagEnum:11:31 (Definition) Extent=[11:1 - 13:2]
26// CHECK: attributes.c:11:19: attribute(flag_enum)= Extent=[11:19 - 11:28]