diff options
author | Dan Gohman <gohman@apple.com> | 2009-09-08 01:44:02 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-09-08 01:44:02 +0000 |
commit | 1b9f83a3e87d2b6cbcf1af525f0b1796c17fd571 (patch) | |
tree | f1cedae0fd81a566765a26bb3f008f2ad8e76496 /test | |
parent | d95bc887780e7af86abcf45c64d8772936ed6475 (diff) | |
download | external_llvm-1b9f83a3e87d2b6cbcf1af525f0b1796c17fd571.zip external_llvm-1b9f83a3e87d2b6cbcf1af525f0b1796c17fd571.tar.gz external_llvm-1b9f83a3e87d2b6cbcf1af525f0b1796c17fd571.tar.bz2 |
Fix an abort on a store of an empty struct member. getValue returns
null in the case of an empty struct, so don't try to call getNumValues
on it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81180 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/CodeGen/X86/store-empty-member.ll | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/CodeGen/X86/store-empty-member.ll b/test/CodeGen/X86/store-empty-member.ll new file mode 100644 index 0000000..98c1a99 --- /dev/null +++ b/test/CodeGen/X86/store-empty-member.ll @@ -0,0 +1,14 @@ +; RUN: llvm-as < %s | llc -march=x86 | FileCheck %s + +; Don't crash on an empty struct member. + +; CHECK: movl $2, 4(%esp) +; CHECK: movl $1, (%esp) + +%testType = type {i32, [0 x i32], i32} + +define void @foo() nounwind { + %1 = alloca %testType + volatile store %testType {i32 1, [0 x i32] zeroinitializer, i32 2}, %testType* %1 + ret void +} |