summaryrefslogtreecommitdiff
path: root/test/Transforms/DSAnalysis/badcases.ll
blob: 571107bf5d181130ecd76701a46a1139bc9bd777 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
; This file contains a list of situations where node folding should happen...
;
; RUN: llvm-upgrade < %s | llvm-as | opt -analyze -tddatastructure

implementation

void %test1({int, int} * %X) {
	getelementptr {int, int} * %X, long 0
	%Y = cast {int, int} * %X to sbyte*
	%Z = getelementptr sbyte* %Y, long 7
	store sbyte 6, sbyte *%Z
	ret void
}

void %test2({int, int} * %X) {
	getelementptr {int, int} * %X, long 0
	%Y = cast {int, int} * %X to {sbyte,sbyte,sbyte,sbyte,sbyte,sbyte,sbyte,sbyte} *
	%Z = getelementptr {sbyte,sbyte,sbyte,sbyte,sbyte,sbyte,sbyte,sbyte}* %Y, long 0, uint 7
	store sbyte 6, sbyte *%Z
	ret void
}