aboutsummaryrefslogtreecommitdiff
path: root/test/Parser/builtin_classify_type.c
blob: 63fd8e28045a1a3ef6c72102a39dfeeedc8d45d8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// RUN: %clang_cc1 -fsyntax-only -verify %s

struct foo { int a; };

int main() {
  int a;
  float b;
  double d;
  struct foo s;

  static int ary[__builtin_classify_type(a)];
  static int ary2[(__builtin_classify_type)(a)]; // expected-error{{variable length array declaration cannot have 'static' storage duration}}
  static int ary3[(*__builtin_classify_type)(a)]; // expected-error{{builtin functions must be directly called}}

  int result;

  result =  __builtin_classify_type(a);
  result =  __builtin_classify_type(b);
  result =  __builtin_classify_type(d);
  result =  __builtin_classify_type(s);
}