diff options
author | Chris Lattner <sabre@nondot.org> | 2012-03-04 00:56:24 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2012-03-04 00:56:24 +0000 |
commit | 332673d39d8a427576af8205580dc63bcdd745b0 (patch) | |
tree | 661b8adacefc82bbbc178f90dd06ece15706bd87 /clang | |
parent | aaa18fad7d7dce440b0bef11d967a5d602730c8d (diff) | |
download | bcm5719-llvm-332673d39d8a427576af8205580dc63bcdd745b0.tar.gz bcm5719-llvm-332673d39d8a427576af8205580dc63bcdd745b0.zip |
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.
llvm-svn: 151994
Diffstat (limited to 'clang')
-rw-r--r-- | clang/test/CodeGen/builtin-memfns.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/clang/test/CodeGen/builtin-memfns.c b/clang/test/CodeGen/builtin-memfns.c index e4389f62114..72d340619f3 100644 --- a/clang/test/CodeGen/builtin-memfns.c +++ b/clang/test/CodeGen/builtin-memfns.c @@ -52,9 +52,13 @@ int test6(char *X) { // 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) |