summaryrefslogtreecommitdiffstats
path: root/test/PCH/decl-in-prototype.c
blob: a291bf2df839f53aee3c37202218e412a941088c (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
27
// Test that we serialize the enum decl in the function prototype somehow.
// These decls aren't serialized quite the same way as parameters.

// Test this without pch.
// RUN: %clang_cc1 -include %s -emit-llvm -o - %s | FileCheck %s

// Test with pch.
// RUN: %clang_cc1 -emit-pch -o %t %s
// RUN: %clang_cc1 -include-pch %t -emit-llvm -o - %s | FileCheck %s

// CHECK-LABEL: define {{.*}}i32 @main()
// CHECK:   ret i32 1

#ifndef HEADER
#define HEADER

static inline __attribute__((always_inline)) f(enum { x, y } p) {
  return y;
}

#else

int main() {
  return f(0);
}

#endif