summaryrefslogtreecommitdiffstats
path: root/test/CodeGen/builtin-memfns.c
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2012-04-14 14:01:31 +0000
committerdim <dim@FreeBSD.org>2012-04-14 14:01:31 +0000
commit50b73317314e889cf39c7b1d6cbf419fa7502f22 (patch)
treebe1815eb79b42ff482a8562b13c2dcbf0c5dcbee /test/CodeGen/builtin-memfns.c
parentdc04cb328508e61aad809d9b53b12f9799a00e7d (diff)
downloadFreeBSD-src-50b73317314e889cf39c7b1d6cbf419fa7502f22.zip
FreeBSD-src-50b73317314e889cf39c7b1d6cbf419fa7502f22.tar.gz
Vendor import of clang trunk r154661:
http://llvm.org/svn/llvm-project/cfe/trunk@r154661
Diffstat (limited to 'test/CodeGen/builtin-memfns.c')
-rw-r--r--test/CodeGen/builtin-memfns.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/CodeGen/builtin-memfns.c b/test/CodeGen/builtin-memfns.c
index fb4d720..72d3406 100644
--- a/test/CodeGen/builtin-memfns.c
+++ b/test/CodeGen/builtin-memfns.c
@@ -48,3 +48,18 @@ void test5(char *P, char *Q) {
int test6(char *X) {
return __builtin___memcpy_chk(X, X, 42, 42) != 0;
}
+
+// CHECK: @test7
+// PR12094
+int test7(int *p) {
+ struct snd_pcm_hw_params_t* hwparams; // incomplete type.
+
+ // CHECK: call void @llvm.memset{{.*}}256, i32 4, i1 false)
+ __builtin_memset(p, 0, 256); // Should be alignment = 4
+
+ // CHECK: call void @llvm.memset{{.*}}256, i32 1, i1 false)
+ __builtin_memset((char*)p, 0, 256); // Should be alignment = 1
+
+ __builtin_memset(hwparams, 0, 256); // No crash alignment = 1
+ // CHECK: call void @llvm.memset{{.*}}256, i32 1, i1 false)
+}
OpenPOWER on IntegriCloud