summaryrefslogtreecommitdiff
path: root/test/Analysis/DSGraph/constant_globals.ll
blob: 2473d1dd831864b746ed41397a16567d04ffd88c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
; FIXME: A should just be SM
; RUN: opt -analyze %s -datastructure-gc -dsgc-dspass=bu -dsgc-check-flags=A:SIM
; Constant globals should not mark stuff incomplete.  This should allow the 
; bu pass to resolve the indirect call immediately in "test", allowing %A to
; be marked complete and the store to happen.

; This is the common case for handling vtables aggressively.

%G = constant void (int*)* %foo 

implementation

void %foo(int *%X) {
  store int 0, int* %X
  ret void
}

void %test() {
  %Fp = load void (int*)** %G
  %A = alloca int
  call void %Fp(int* %A)
  ret void
}