From fc74ff5a0792641885551a63d9ddf8cbfdf76e3c Mon Sep 17 00:00:00 2001 From: dim <dim@FreeBSD.org> Date: Wed, 6 Jan 2016 20:02:26 +0000 Subject: Vendor import of clang trunk r256945: https://llvm.org/svn/llvm-project/cfe/trunk@256945 --- test/CodeGen/nobuiltin.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'test/CodeGen/nobuiltin.c') diff --git a/test/CodeGen/nobuiltin.c b/test/CodeGen/nobuiltin.c index 0a8e8bb..7cc8164 100644 --- a/test/CodeGen/nobuiltin.c +++ b/test/CodeGen/nobuiltin.c @@ -1,4 +1,5 @@ // RUN: %clang_cc1 -fno-builtin -O1 -S -o - %s | FileCheck %s +// RUN: %clang_cc1 -fno-builtin-memset -O1 -S -o - %s | FileCheck -check-prefix=MEMSET %s void PR13497() { char content[2]; @@ -6,3 +7,11 @@ void PR13497() { // CHECK: __strcpy_chk __builtin___strcpy_chk(content, "", 1); } + +void PR4941(char *s) { + // Make sure we don't optimize this loop to a memset(). + // MEMSET-LABEL: PR4941: + // MEMSET-NOT: memset + for (unsigned i = 0; i < 8192; ++i) + s[i] = 0; +} -- cgit v1.1