[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / clang / test / AST / attr-print-emit.cpp
blob8c48eb92daba5ee8387b6378fcca1d5e53c1db96
1 // RUN: %clang_cc1 %s -ast-print | FileCheck %s
2 // RUN: %clang -emit-ast -o %t.ast %s
3 // RUN: %clang_cc1 %t.ast -ast-print | FileCheck %s
5 // CHECK: void *aa() __attribute__((assume_aligned(64)));
6 void *aa() __attribute__((assume_aligned(64)));
8 // CHECK: void *aa2() __attribute__((assume_aligned(64, 8)));
9 void *aa2() __attribute__((assume_aligned(64, 8)));
11 // CHECK: void xla(int a) __attribute__((xray_log_args(1)));
12 void xla(int a) __attribute__((xray_log_args(1)));
14 // CHECK: void *as2(int, int) __attribute__((alloc_size(1, 2)));
15 void *as2(int, int) __attribute__((alloc_size(1, 2)));
16 // CHECK: void *as1(void *, int) __attribute__((alloc_size(2)));
17 void *as1(void *, int) __attribute__((alloc_size(2)));
19 // CHECK: void fmt(int, const char *, ...) __attribute__((format(printf, 2, 3)));
20 void fmt(int, const char *, ...) __attribute__((format(printf, 2, 3)));
22 // CHECK: char *fmta(int, const char *) __attribute__((format_arg(2)));
23 char *fmta(int, const char *) __attribute__((format_arg(2)));
25 // CHECK: void nn(int *, int *) __attribute__((nonnull(1, 2)));
26 void nn(int *, int *) __attribute__((nonnull(1, 2)));
28 // CHECK: int *aa(int i) __attribute__((alloc_align(1)));
29 int *aa(int i) __attribute__((alloc_align(1)));
31 // CHECK: void ownt(int *, int *) __attribute__((ownership_takes(foo, 1, 2)));
32 void ownt(int *, int *) __attribute__((ownership_takes(foo, 1, 2)));
33 // CHECK: void ownh(int *, int *) __attribute__((ownership_holds(foo, 1, 2)));
34 void ownh(int *, int *) __attribute__((ownership_holds(foo, 1, 2)));
35 // CHECK: void ownr(int) __attribute__((ownership_returns(foo, 1)));
36 void ownr(int) __attribute__((ownership_returns(foo, 1)));
38 // CHECK: void awtt(int, int, ...) __attribute__((argument_with_type_tag(foo, 3, 2)));
39 void awtt(int, int, ...) __attribute__((argument_with_type_tag(foo, 3, 2)));
40 // CHECK: void pwtt(void *, int) __attribute__((pointer_with_type_tag(foo, 1, 2)));
41 void pwtt(void *, int) __attribute__((pointer_with_type_tag(foo, 1, 2)));
43 class C {
44 // CHECK: void xla(int a) __attribute__((xray_log_args(2)));
45 void xla(int a) __attribute__((xray_log_args(2)));
47 // CHECK: void *as2(int, int) __attribute__((alloc_size(2, 3)));
48 void *as2(int, int) __attribute__((alloc_size(2, 3)));
49 // CHECK: void *as1(void *, int) __attribute__((alloc_size(3)));
50 void *as1(void *, int) __attribute__((alloc_size(3)));
52 // CHECK: void fmt(int, const char *, ...) __attribute__((format(printf, 3, 4)));
53 void fmt(int, const char *, ...) __attribute__((format(printf, 3, 4)));
55 // CHECK: char *fmta(int, const char *) __attribute__((format_arg(3)));
56 char *fmta(int, const char *) __attribute__((format_arg(3)));
58 // CHECK: void nn(int *, int *) __attribute__((nonnull(2, 3)));
59 void nn(int *, int *) __attribute__((nonnull(2, 3)));
61 // CHECK: int *aa(int i) __attribute__((alloc_align(2)));
62 int *aa(int i) __attribute__((alloc_align(2)));
64 // CHECK: void ownt(int *, int *) __attribute__((ownership_takes(foo, 2, 3)));
65 void ownt(int *, int *) __attribute__((ownership_takes(foo, 2, 3)));
66 // CHECK: void ownh(int *, int *) __attribute__((ownership_holds(foo, 2, 3)));
67 void ownh(int *, int *) __attribute__((ownership_holds(foo, 2, 3)));
68 // CHECK: void ownr(int) __attribute__((ownership_returns(foo, 2)));
69 void ownr(int) __attribute__((ownership_returns(foo, 2)));
71 // CHECK: void awtt(int, int, ...) __attribute__((argument_with_type_tag(foo, 4, 3)));
72 void awtt(int, int, ...) __attribute__((argument_with_type_tag(foo, 4, 3)));
73 // CHECK: void pwtt(void *, int) __attribute__((pointer_with_type_tag(foo, 2, 3)));
74 void pwtt(void *, int) __attribute__((pointer_with_type_tag(foo, 2, 3)));