aboutsummaryrefslogtreecommitdiff
path: root/clang/test/CodeGen/bpf-preserve-static-offset-non-bpf.c
blob: 0ddf603856a4478f77f2f0e7a286ccfd4c6daf48 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// REQUIRES: x86-registered-target
// RUN: %clang_cc1 -triple x86_64 -disable-llvm-passes -emit-llvm -o - %s | FileCheck %s

// Verify that __attribute__((preserve_static_offset))
// has no effect for non-BPF target.

#define __ctx __attribute__((preserve_static_offset))

struct foo {
  int a;
} __ctx;

// CHECK-NOT: @llvm_preserve_static_offset

int bar(struct foo *p) {
  return p->a;
}