comparison test/CodeGen/SPARC/func-addr.ll @ 120:1172e4bd9c6f

update 4.0.0
author mir3636
date Fri, 25 Nov 2016 19:14:25 +0900
parents
children
comparison
equal deleted inserted replaced
101:34baf5011add 120:1172e4bd9c6f
1 ; RUN: llc < %s -march=sparc -relocation-model=static -code-model=small | FileCheck --check-prefix=abs32 %s
2 ; RUN: llc < %s -march=sparcv9 -relocation-model=static -code-model=small | FileCheck --check-prefix=abs32 %s
3 ; RUN: llc < %s -march=sparcv9 -relocation-model=static -code-model=medium | FileCheck --check-prefix=abs44 %s
4 ; RUN: llc < %s -march=sparcv9 -relocation-model=static -code-model=large | FileCheck --check-prefix=abs64 %s
5 ; RUN: llc < %s -march=sparc -relocation-model=pic -code-model=medium | FileCheck --check-prefix=v8pic32 %s
6 ; RUN: llc < %s -march=sparcv9 -relocation-model=pic -code-model=medium | FileCheck --check-prefix=v9pic32 %s
7
8 define void @func1() #0 {
9 entry:
10 ret void
11 }
12
13 define void @test() #0 {
14 entry:
15 %pFunc = alloca void (...)*, align 4
16 store void (...)* bitcast (void ()* @func1 to void (...)*), void (...)** %pFunc, align 4
17 %0 = load void (...)*, void (...)** %pFunc, align 4
18 %callee.knr.cast = bitcast void (...)* %0 to void ()*
19 call void %callee.knr.cast()
20
21 ; abs32-LABEL: test
22 ; abs32: sethi %hi(func1), %i0
23 ; abs32: add %i0, %lo(func1), %i1
24 ; abs32: call %i0+%lo(func1)
25
26 ; abs44-LABEL: test
27 ; abs44: sethi %h44(func1), %i0
28 ; abs44: add %i0, %m44(func1), %i0
29 ; abs44: sllx %i0, 12, %i0
30 ; abs44: add %i0, %l44(func1), %i1
31 ; abs44: call %i0+%l44(func1)
32
33 ; abs64-LABEL: test
34 ; abs64: sethi %hi(func1), %i0
35 ; abs64: add %i0, %lo(func1), %i0
36 ; abs64: sethi %hh(func1), %i1
37 ; abs64: add %i1, %hm(func1), %i1
38
39 ; v8pic32-LABEL: test
40 ; v8pic32: sethi %hi(func1), %i1
41 ; v8pic32: add %i1, %lo(func1), %i1
42 ; v8pic32: ld [%i0+%i1], %i0
43
44 ; v9pic32-LABEL: test
45 ; v9pic32: sethi %hi(func1), %i1
46 ; v9pic32: add %i1, %lo(func1), %i1
47 ; v9pic32: ldx [%i0+%i1], %i0
48 ; v9pic32: call %i0
49
50 ret void
51 }