[clang-format] Fix a bug in aligning comments above PPDirective (#72791)
[llvm-project.git] / clang / test / Preprocessor / bpf-predefined-macros.c
blobff4d00ac3bcfcc1d4c36571e559199a661588f92
1 // RUN: %clang -E -target bpfel -x c -o - %s | FileCheck -check-prefix=CHECK -check-prefix=CPU_NO %s
2 // RUN: %clang -E -target bpfeb -x c -o - %s | FileCheck -check-prefix=CHECK -check-prefix=CPU_NO %s
3 // RUN: %clang -E -target bpfel -mcpu=v1 -x c -o - %s | FileCheck -check-prefix=CHECK -check-prefix=CPU_V1 %s
4 // RUN: %clang -E -target bpfel -mcpu=v2 -x c -o - %s | FileCheck -check-prefix=CHECK -check-prefix=CPU_V2 %s
5 // RUN: %clang -E -target bpfel -mcpu=v3 -x c -o - %s | FileCheck -check-prefix=CHECK -check-prefix=CPU_V3 %s
6 // RUN: %clang -E -target bpfel -mcpu=v4 -x c -o - %s | FileCheck -check-prefix=CHECK -check-prefix=CPU_V4 %s
7 // RUN: %clang -E -target bpfel -mcpu=generic -x c -o - %s | FileCheck -check-prefix=CHECK -check-prefix=CPU_GENERIC %s
8 // RUN: %clang -E -target bpfel -mcpu=probe -x c -o - %s | FileCheck -check-prefix=CHECK -check-prefix=CPU_PROBE %s
10 #ifdef __bpf__
11 int b;
12 #endif
13 #ifdef __BPF__
14 int c;
15 #endif
16 #ifdef bpf
17 int d;
18 #endif
19 #ifdef __BPF_CPU_VERSION__
20 int e;
21 #endif
22 #if __BPF_CPU_VERSION__ == 0
23 int f;
24 #endif
25 #if __BPF_CPU_VERSION__ == 1
26 int g;
27 #endif
28 #if __BPF_CPU_VERSION__ == 2
29 int h;
30 #endif
31 #if __BPF_CPU_VERSION__ == 3
32 int i;
33 #endif
34 #if __BPF_CPU_VERSION__ == 4
35 int j;
36 #endif
37 #ifdef __BPF_FEATURE_JMP_EXT
38 int k;
39 #endif
40 #ifdef __BPF_FEATURE_JMP32
41 int l;
42 #endif
43 #ifdef __BPF_FEATURE_ALU32
44 int m;
45 #endif
46 #ifdef __BPF_FEATURE_LDSX
47 int n;
48 #endif
49 #ifdef __BPF_FEATURE_MOVSX
50 int o;
51 #endif
52 #ifdef __BPF_FEATURE_BSWAP
53 int p;
54 #endif
55 #ifdef __BPF_FEATURE_SDIV_SMOD
56 int q;
57 #endif
58 #ifdef __BPF_FEATURE_GOTOL
59 int r;
60 #endif
61 #ifdef __BPF_FEATURE_ST
62 int s;
63 #endif
65 // CHECK: int b;
66 // CHECK: int c;
67 // CHECK-NOT: int d;
68 // CHECK: int e;
70 // CPU_NO: int g;
72 // CPU_V1: int g;
74 // CPU_V2: int h;
75 // CPU_V2: int k;
77 // CPU_V3: int i;
78 // CPU_V3: int k;
79 // CPU_V3: int l;
80 // CPU_V3: int m;
82 // CPU_V4: int j;
83 // CPU_V4: int k;
84 // CPU_V4: int l;
85 // CPU_V4: int m;
86 // CPU_V4: int n;
87 // CPU_V4: int o;
88 // CPU_V4: int p;
89 // CPU_V4: int q;
90 // CPU_V4: int r;
91 // CPU_V4: int s;
93 // CPU_GENERIC: int g;
95 // CPU_PROBE: int f;