summaryrefslogtreecommitdiffstats
path: root/clang/test/Preprocessor/has_c_attribute.c
blob: f8b0b364faa5f69a5af7549a7976715cb289125d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// RUN: %clang_cc1 -fdouble-square-bracket-attributes -std=c11 -E %s -o - | FileCheck %s
// RUN: %clang_cc1 -std=c2x -E %s -o - | FileCheck %s

// CHECK: has_fallthrough
#if __has_c_attribute(fallthrough)
  int has_fallthrough();
#endif

// CHECK: does_not_have_selectany
#if !__has_c_attribute(selectany)
  int does_not_have_selectany();
#endif

// CHECK: has_nodiscard_underscore
#if __has_c_attribute(__nodiscard__)
  int has_nodiscard_underscore();
#endif

// CHECK: has_clang_annotate
#if __has_c_attribute(clang::annotate)
  int has_clang_annotate();
#endif
OpenPOWER on IntegriCloud