aboutsummaryrefslogtreecommitdiffstats
path: root/test/inlinetest.ll
blob: 7f1b1c3dd9dbdf2371cef9c4a0ab1175f4e9b4ae (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
26
27
implementation

int "FuncToInline"()
begin
	%x = add int 1, 1            ; Instrs can be const prop'd away
        %y = sub int -1, 1
        %z = add int %x, %y
	ret int %z                     ; Should equal %0
end

int "FuncToInlineInto"(int %arg)     ; Instrs can be const prop'd away
begin
	%x = add int %arg, 1
        %y = sub int 1, -1
        %p = call int %FuncToInline()
        %z = add int %x, %y
        %q = add int %p, %z

	ret int %q
end

int "main"()
begin
        %z = call int %FuncToInlineInto(int 1)
        ret int %z
end