blob: 957502f2d99cee5f6bc00f6c78b8f5ff64af6a87 [file] [log] [blame]
Chris Lattner659a5002003-12-11 19:16:30 +00001; This testcase consists of alias relations which should be completely
2; resolvable by basicaa, but require analysis of getelementptr constant exprs.
3
Chandler Carruth5da53432012-07-02 18:37:59 +00004; RUN: opt < %s -basicaa -aa-eval -print-may-aliases -disable-output 2>&1 | FileCheck %s
Chris Lattner659a5002003-12-11 19:16:30 +00005
Ahmed Bougachaa7e33112015-02-05 21:10:14 +00006target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
7
Tanya Lattnerf865dcd2008-02-14 06:56:27 +00008%T = type { i32, [10 x i8] }
Chris Lattner659a5002003-12-11 19:16:30 +00009
Tanya Lattnerf865dcd2008-02-14 06:56:27 +000010@G = external global %T
Chris Lattner659a5002003-12-11 19:16:30 +000011
Bill Wendlingcd6df162012-04-24 09:15:38 +000012; CHECK: Function: test
Ahmed Bougachaa7e33112015-02-05 21:10:14 +000013; CHECK-NOT: MayAlias:
Bill Wendlingcd6df162012-04-24 09:15:38 +000014
Tanya Lattnerf865dcd2008-02-14 06:56:27 +000015define void @test() {
David Blaikie79e6c742015-02-27 19:29:02 +000016 %D = getelementptr %T, %T* @G, i64 0, i32 0
17 %E = getelementptr %T, %T* @G, i64 0, i32 1, i64 5
David Blaikief72d05b2015-03-13 18:20:45 +000018 %F = getelementptr i32, i32* getelementptr (%T, %T* @G, i64 0, i32 0), i64 0
19 %X = getelementptr [10 x i8], [10 x i8]* getelementptr (%T, %T* @G, i64 0, i32 1), i64 0, i64 5
Chris Lattner659a5002003-12-11 19:16:30 +000020
21 ret void
22}