summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-10-23 17:57:43 +0000
committerDan Gohman <gohman@apple.com>2009-10-23 17:57:43 +0000
commit4ef112be6270f04fa7966288c990d95ec43c62fd (patch)
tree7b9f3f6a10c833598f7a5cfd43c4eda01da2c406 /llvm/test
parent24e7cb6f2604bfa56cde4d7adf88202e001d9d0d (diff)
downloadbcm5719-llvm-4ef112be6270f04fa7966288c990d95ec43c62fd.tar.gz
bcm5719-llvm-4ef112be6270f04fa7966288c990d95ec43c62fd.zip
APInt-ify the gep scaling code, so that it correctly handles the case where
the scale overflows pointer-sized arithmetic. This fixes PR5281. llvm-svn: 84954
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/CodeGen/X86/large-gep-scale.ll12
1 files changed, 12 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/X86/large-gep-scale.ll b/llvm/test/CodeGen/X86/large-gep-scale.ll
new file mode 100644
index 00000000000..143294e8b07
--- /dev/null
+++ b/llvm/test/CodeGen/X86/large-gep-scale.ll
@@ -0,0 +1,12 @@
+; RUN: llc < %s -march=x86 | FileCheck %s
+; PR5281
+
+; After scaling, this type doesn't fit in memory. Codegen should generate
+; correct addressing still.
+
+; CHECK: shll $2, %edx
+
+define fastcc i32* @_ada_smkr([2147483647 x i32]* %u, i32 %t) nounwind {
+ %x = getelementptr [2147483647 x i32]* %u, i32 %t, i32 0
+ ret i32* %x
+}
OpenPOWER on IntegriCloud