aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/c-c++-common/hwasan/check-interface.c
blob: 90f52cac884dd67b1dab18d4037fe64dfc19eefc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/* { dg-do run } */
/* { dg-require-effective-target hwaddress_exec } */
/*
   Test taken from LLVM
    compiler-rt/test/hwasan/TestCases/check-interface.cpp
 */
// Utilizes all flavors of __hwasan_load/store interface functions to verify
// that the instrumentation and the interface provided by HWASan do match.
// In case of a discrepancy, this test fails to link.

typedef __UINT8_TYPE__ uint8_t;
typedef __UINT16_TYPE__ uint16_t;
typedef __UINT32_TYPE__ uint32_t;
typedef __UINT64_TYPE__ uint64_t;

#define F(T) void f_##T(T *a, T *b) { *a = *b; }

F(uint8_t)
F(uint16_t)
F(uint32_t)
F(uint64_t)

typedef unsigned V32 __attribute__((__vector_size__(32)));
F(V32)

int main() {}