xref: /llvm-project/clang/test/CodeGen/bpf-preserve-access-index-2.c (revision 048493f882faf19d80a1343d877d69cbb19c5091)
1*048493f8SYonghong Song // RUN: %clang %s -target bpfeb -x c -emit-llvm -S -g -O2 -o - | FileCheck %s
2*048493f8SYonghong Song // RUN: %clang %s -target bpfel -x c -emit-llvm -S -g -O2 -o - | FileCheck %s
3*048493f8SYonghong Song 
4*048493f8SYonghong Song struct t {
5*048493f8SYonghong Song   int i:1;
6*048493f8SYonghong Song   int j:2;
7*048493f8SYonghong Song   union {
8*048493f8SYonghong Song    int a;
9*048493f8SYonghong Song    int b;
10*048493f8SYonghong Song   } c[4];
11*048493f8SYonghong Song };
12*048493f8SYonghong Song 
13*048493f8SYonghong Song #define _(x) (x)
14*048493f8SYonghong Song 
test(struct t * arg)15*048493f8SYonghong Song const void *test(struct t *arg) {
16*048493f8SYonghong Song   return _(&arg->c[3].b);
17*048493f8SYonghong Song }
18*048493f8SYonghong Song 
19*048493f8SYonghong Song // CHECK-NOT: llvm.preserve.struct.access.index
20*048493f8SYonghong Song // CHECK-NOT: llvm.preserve.array.access.index
21*048493f8SYonghong Song // CHECK-NOT: llvm.preserve.union.access.index
22*048493f8SYonghong Song // CHECK-NOT: __builtin_preserve_access_index
23