summaryrefslogtreecommitdiffstats
path: root/clang/test/PCH/decl-in-prototype.c
blob: 865775a8fdbddb1658c34671f89efc6d6517faa1 (plain) (blame)
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(void) {
  return f(0);
}

#endif