Skip to content

Commit ddab5d5

Browse files
brooksdavisresistor
authored andcommitted
tests: prefer __has_feature(capabilities) to defined(__CHERI__)
1 parent f374adc commit ddab5d5

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

clang/test/CodeGen/builtin-align.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
#error MISSING TYPE
4141
#endif
4242

43-
#ifndef __CHERI__
43+
#if !__has_feature(capabilities)
4444
#define __capability
4545
#endif
4646

clang/test/SemaCXX/cheri/cheri-pointer-cast.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ typedef unsigned long ulong;
99

1010
int foo;
1111

12-
#ifdef __CHERI__
12+
#if __has_feature(capabilities)
1313
#define CAP __capability
1414
#else
1515
#define CAP
@@ -68,7 +68,7 @@ int main() {
6868
}
6969

7070
// Check that we don't warn on dependent types
71-
#ifdef __CHERI__
71+
#if __has_feature(capabilities)
7272
template <typename T>
7373
long offset_get(T x) {
7474
return __builtin_cheri_offset_get(reinterpret_cast<void * __capability>(x));

0 commit comments

Comments
 (0)