From b1032a8a2f322e031f7c0947c3fb60fe9e8a10e6 Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Mon, 9 Feb 2009 20:54:38 +0000 Subject: Make sure constant subscript is truncated to ptr size if it may not fit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64163 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/CodeGen/X86/negative-subscript.ll | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 test/CodeGen/X86/negative-subscript.ll (limited to 'test') diff --git a/test/CodeGen/X86/negative-subscript.ll b/test/CodeGen/X86/negative-subscript.ll new file mode 100644 index 0000000..f2bd315 --- /dev/null +++ b/test/CodeGen/X86/negative-subscript.ll @@ -0,0 +1,10 @@ +; RUN: llvm-as < %s | llc -march=x86 +; rdar://6559995 + +@a = external global [255 x i8*], align 32 + +define i32 @main() nounwind { +entry: + store i8* bitcast (i8** getelementptr ([255 x i8*]* @a, i32 0, i32 -2147483624) to i8*), i8** getelementptr ([255 x i8*]* @a, i32 0, i32 16), align 32 + ret i32 0 +} -- cgit v1.1