summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/X86/alias-gep.ll
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/test/CodeGen/X86/alias-gep.ll')
-rw-r--r--llvm/test/CodeGen/X86/alias-gep.ll22
1 files changed, 22 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/X86/alias-gep.ll b/llvm/test/CodeGen/X86/alias-gep.ll
new file mode 100644
index 00000000000..5ecf20ba78e
--- /dev/null
+++ b/llvm/test/CodeGen/X86/alias-gep.ll
@@ -0,0 +1,22 @@
+; RUN: llc < %s -mtriple=x86_64-apple-darwin | FileCheck --check-prefix=MACHO %s
+; RUN: llc < %s -mtriple=x86_64-pc-linux | FileCheck --check-prefix=ELF %s
+
+;MACHO: .globl _offsetSym0
+;MACHO-NOT: .alt_entry
+;MACHO: _offsetSym0 = _s
+;MACHO: .globl _offsetSym1
+;MACHO: .alt_entry _offsetSym1
+;MACHO: _offsetSym1 = _s+8
+
+;ELF: .globl offsetSym0
+;ELF-NOT: .alt_entry
+;ELF: offsetSym0 = s
+;ELF: .globl offsetSym1
+;ELF-NOT: .alt_entry
+;ELF: offsetSym1 = s+8
+
+%struct.S1 = type { i32, i32, i32 }
+
+@s = global %struct.S1 { i32 31, i32 32, i32 33 }, align 4
+@offsetSym0 = alias i32, i32* getelementptr inbounds (%struct.S1, %struct.S1* @s, i64 0, i32 0)
+@offsetSym1 = alias i32, i32* getelementptr inbounds (%struct.S1, %struct.S1* @s, i64 0, i32 2)
OpenPOWER on IntegriCloud