Clang Project

clang_source_code/test/CodeGen/decl-in-prototype.c
1// RUN: %clang_cc1 -triple i386-linux -debug-info-kind=limited -emit-llvm -o - %s | FileCheck %s
2
3const int AA = 5;
4
5// CHECK-LABEL: define i32 @f1
6int f1(enum {AA,BB} E) {
7    // CHECK: ret i32 1
8    return BB;
9}
10
11// CHECK-LABEL: define i32 @f2
12int f2(enum {AA=7,BB} E) {
13    // CHECK: ret i32 7
14    return AA;
15}
16
17// Check nested function declarators work.
18int f(void (*g)(), enum {AA,BB} h) {
19    // CHECK: ret i32 0
20    return AA;
21}
22
23// This used to crash with debug info enabled.
24int pr31366(struct { enum { a = 1 } b; } c) {
25  return a;
26}
27