llvm-project/clang/test/Sema/bpf-attr-preserve-access-index.cpp
Yonghong Song dd16b3fe25 [BPF] Restrict preserve_access_index attribute to C only
This patch is a follow-up for commit 4e2ce228ae79
  [BPF] Add preserve_access_index attribute for record definition
to restrict attribute for C only. A new test case is added
to check for this restriction.

Additional code polishing is done based on
Aaron Ballman's suggestion in https://reviews.llvm.org/D69759/new/.

Differential Revision: https://reviews.llvm.org/D70257
2019-11-14 14:14:59 -08:00

10 lines
275 B
C++

// RUN: %clang_cc1 -x c++ -triple bpf-pc-linux-gnu -dwarf-version=4 -fsyntax-only -verify %s
#define __reloc__ __attribute__((preserve_access_index))
struct t1 {
int a;
int b[4];
int c:1;
} __reloc__; // expected-warning {{'preserve_access_index' attribute ignored}}