// RUN: %clang_cc1 -triple i386-unknown-unknown %s -O3 -emit-llvm -o - | grep 'ret i32 6'
// RUN: %clang_cc1 -triple i386-unknown-unknown -x c++ %s -O3 -emit-llvm -o - | grep 'ret i32 7'

static enum { foo, bar = 1U } z;

int main (void)
{
  int r = 0;

  if (bar - 2 < 0)
    r += 4;
  if (foo - 1 < 0)
    r += 2;
  if (z - 1 < 0)
    r++;

  return r;
}


// RUN: %clang_cc1 -triple i386-unknown-unknown %s -O3 -emit-llvm -o - | grep 'ret i32 6'
// RUN: %clang_cc1 -triple i386-unknown-unknown -x c++ %s -O3 -emit-llvm -o - | grep 'ret i32 7'

// This test case illustrates a peculiarity of the promotion of
// enumeration types in C and C++. In particular, the enumeration type
// "z" below promotes to an unsigned int in C but int in C++.
static enum { foo, bar = 1U } z;

int main (void)
{
  int r = 0;

  if (bar - 2 < 0)
    r += 4;
  if (foo - 1 < 0)
    r += 2;
  if (z - 1 < 0)
    r++;

  return r;
}


Comment a wacky test case
Comment a wacky test case

git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@123758 91177308-0d34-0410-b5e6-96231b3b80d8
