diff options
author | Chris Lattner <sabre@nondot.org> | 2012-03-04 00:52:12 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2012-03-04 00:52:12 +0000 |
commit | d6e73569ccf09369f9bd2021d53c88e7bded06e3 (patch) | |
tree | 33308283dc27a2f3292516776f3d9a1682bbe1ca /test/CodeGen | |
parent | ec92bc78979aae6ec436fe51d082f7467e6f96c0 (diff) |
add a testcase for PR12094 and fix a crash on pointer to incomplete type,
reported by Richard Smith.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151993 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen')
-rw-r--r-- | test/CodeGen/builtin-memfns.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/CodeGen/builtin-memfns.c b/test/CodeGen/builtin-memfns.c index fb4d720075..e4389f6211 100644 --- a/test/CodeGen/builtin-memfns.c +++ b/test/CodeGen/builtin-memfns.c @@ -48,3 +48,14 @@ 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) { + // 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. + + __builtin_memset(hwparams, 0, 256); // No crash alignment = 1 + // CHECK: call void @llvm.memset{{.*}}256, i32 1, i1 false) +} |