summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGen/builtins.c
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2017-11-09 09:32:32 +0000
committerJohn McCall <rjmccall@apple.com>2017-11-09 09:32:32 +0000
commit26d55e0346964a46978c873b4d4bde01df4ea977 (patch)
treedca29012466e118aebaa0c15ffcc43f7a8df546a /clang/test/CodeGen/builtins.c
parent5bfa5ffe5ebe515caa22ad65f62df124ed2a7c7c (diff)
downloadbcm5719-llvm-26d55e0346964a46978c873b4d4bde01df4ea977.tar.gz
bcm5719-llvm-26d55e0346964a46978c873b4d4bde01df4ea977.zip
Fix a bug with the use of __builtin_bzero in a conditional expression.
Patch by Bharathi Seshadri! llvm-svn: 317776
Diffstat (limited to 'clang/test/CodeGen/builtins.c')
-rw-r--r--clang/test/CodeGen/builtins.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/clang/test/CodeGen/builtins.c b/clang/test/CodeGen/builtins.c
index 86bee451ecb..0207bb6c9fe 100644
--- a/clang/test/CodeGen/builtins.c
+++ b/clang/test/CodeGen/builtins.c
@@ -176,6 +176,19 @@ void bar() {
}
// CHECK: }
+// CHECK-LABEL: define void @test_conditional_bzero
+void test_conditional_bzero() {
+ char dst[20];
+ int _sz = 20, len = 20;
+ return (_sz
+ ? ((_sz >= len)
+ ? __builtin_bzero(dst, len)
+ : foo())
+ : __builtin_bzero(dst, len));
+ // CHECK: call void @llvm.memset
+ // CHECK: call void @llvm.memset
+ // CHECK-NOT: phi
+}
// CHECK-LABEL: define void @test_float_builtins
void test_float_builtins(float F, double D, long double LD) {
OpenPOWER on IntegriCloud