Debian Codegraph @

clang/test/Preprocessor/bpf-predefined-macros.c

raw
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
9
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
64 #ifdef __BPF_FEATURE_ADDR_SPACE_CAST
65 int t;
66 #endif
67
68 // CHECK: int b;
69 // CHECK: int c;
70 // CHECK-NOT: int d;
71 // CHECK: int e;
72
73 // CPU_NO: int g;
74
75 // CPU_V1: int g;
76
77 // CPU_V2: int h;
78 // CPU_V2: int k;
79
80 // CPU_V3: int i;
81 // CPU_V3: int k;
82 // CPU_V3: int l;
83 // CPU_V3: int m;
84
85 // CPU_V4: int j;
86 // CPU_V4: int k;
87 // CPU_V4: int l;
88 // CPU_V4: int m;
89 // CPU_V4: int n;
90 // CPU_V4: int o;
91 // CPU_V4: int p;
92 // CPU_V4: int q;
93 // CPU_V4: int r;
94 // CPU_V4: int s;
95
96 // CPU_V1: int t;
97 // CPU_V2: int t;
98 // CPU_V3: int t;
99 // CPU_V4: int t;
100
101 // CPU_GENERIC: int g;
102
103 // CPU_PROBE: int f;