testcase for recent bugfix
[oota-llvm.git] / test / CFrontend / cast-to-bool.c
1 // RUN: %llvmgcc -S %s -o - | grep 'trunc.*to bool'
2 // RUN: %llvmgcc -S %s -o - | llvm-as | opt -instcombine | llc -march=x86 | grep 'test.*1'
3 int
4 main ( int argc, char** argv)
5 {
6   int i;
7   int result = 1;
8   for (i = 2; i <= 3; i++)
9     {
10       if ((i & 1) == 0)
11         {
12             result = result + 17;
13         }
14     }
15   return result;
16 }