From 110eaaceddcec790f7e6a5e3bf1261c9aa1e73ab Mon Sep 17 00:00:00 2001 From: dim <dim@FreeBSD.org> Date: Mon, 2 May 2011 19:39:53 +0000 Subject: Vendor import of clang trunk r130700: http://llvm.org/svn/llvm-project/cfe/trunk@130700 --- test/CodeGen/conditional.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'test/CodeGen/conditional.c') diff --git a/test/CodeGen/conditional.c b/test/CodeGen/conditional.c index d079aaf..15e15f1 100644 --- a/test/CodeGen/conditional.c +++ b/test/CodeGen/conditional.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -emit-llvm %s -o %t +// RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck %s float test1(int cond, float a, float b) { return cond ? a : b; @@ -47,3 +47,22 @@ void test9(struct test9 *p) { p ? p : test9spare(); } +// CHECK: @test10 +// CHECK: select i1 {{.*}}, i32 4, i32 5 +int test10(int c) { + return c ? 4 : 5; +} +enum { Gronk = 5 }; + +// rdar://9289603 +// CHECK: @test11 +// CHECK: select i1 {{.*}}, i32 4, i32 5 +int test11(int c) { + return c ? 4 : Gronk; +} + +// CHECK: @test12 +// CHECK: select i1 {{.*}}, double 4.0{{.*}}, double 2.0 +double test12(int c) { + return c ? 4.0 : 2.0; +} -- cgit v1.1