aboutsummaryrefslogtreecommitdiffstats
path: root/test/CFrontend
diff options
context:
space:
mode:
Diffstat (limited to 'test/CFrontend')
-rw-r--r--test/CFrontend/cast-to-bool.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/CFrontend/cast-to-bool.c b/test/CFrontend/cast-to-bool.c
new file mode 100644
index 0000000..ddf21b0
--- /dev/null
+++ b/test/CFrontend/cast-to-bool.c
@@ -0,0 +1,16 @@
+// RUN: %llvmgcc -S %s -o - | grep 'trunc.*to bool'
+// RUN: %llvmgcc -S %s -o - | llvm-as | llc -march=x86 | grep and
+int
+main ( int argc, char** argv)
+{
+ int i;
+ int result = 1;
+ for (i = 2; i <= 3; i++)
+ {
+ if ((i & 1) == 0)
+ {
+ result = result + 17;
+ }
+ }
+ return result;
+}