summaryrefslogtreecommitdiff
path: root/test/Analysis/DSGraph/SCCSimpleExample.ll
blob: c742afa25f6fbe9bc37ee1f503a7a8f2081cb0c0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25

; RUN: llvm-as < %s | opt -analyze -datastructure-gc --dsgc-abort-if-merged=Y,BVal

implementation

internal void %F1(int* %X) {
	%Y = alloca int
	store int 4, int* %Y
	%BVal = call int* %F2(int* %Y)
	ret void
}

internal int* %F2(int* %A) {
	%B = malloc int
	store int 4, int* %B
	call void %F1(int* %B)
	ret int* %B
}

int %main() {
	%Q = malloc int
	store int 4, int* %Q
	call void %F1(int* %Q)
	ret int 0
}