[cfe-commits] r151994 - /cfe/trunk/test/CodeGen/builtin-memfns.c

Chris Lattner sabre at nondot.org
Sat Mar 3 16:56:24 PST 2012


Author: lattner
Date: Sat Mar  3 18:56:24 2012
New Revision: 151994

URL: http://llvm.org/viewvc/llvm-project?rev=151994&view=rev
Log:
>From his comment in PR12168, Eli seems confused about the alignment assumptions
we're making.  We only ignore implicit casts.  Add a testcase showing that
we get the right behavior with explicit casts.

Modified:
    cfe/trunk/test/CodeGen/builtin-memfns.c

Modified: cfe/trunk/test/CodeGen/builtin-memfns.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/builtin-memfns.c?rev=151994&r1=151993&r2=151994&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/builtin-memfns.c (original)
+++ cfe/trunk/test/CodeGen/builtin-memfns.c Sat Mar  3 18:56:24 2012
@@ -52,9 +52,13 @@
 // 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
-  struct snd_pcm_hw_params_t* hwparams;  // incomplete type.
+
+  // 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)





More information about the cfe-commits mailing list