blob: 08dad74843e46f27f3bac9f5e300983c1c51844a [file] [log] [blame]
Chris Lattner965ebea2010-01-19 06:39:54 +00001; RUN: llc < %s -march=cellspu -asm-verbose=0 > %t1.s
2; RUN: llc < %s -march=cellspu -mattr=large_mem -asm-verbose=0 > %t2.s
Scott Michelf9f42e62008-01-29 02:16:57 +00003; RUN: grep bisl %t1.s | count 7
Chris Lattnerb39abf92008-01-18 19:53:43 +00004; RUN: grep ila %t1.s | count 1
Evan Cheng76ebe862009-12-09 01:53:58 +00005; RUN: grep rotqby %t1.s | count 5
Scott Michelf9f42e62008-01-29 02:16:57 +00006; RUN: grep lqa %t1.s | count 1
Scott Michel6965c382008-11-09 01:03:41 +00007; RUN: grep lqd %t1.s | count 12
8; RUN: grep dispatch_tab %t1.s | count 5
Chris Lattnerb39abf92008-01-18 19:53:43 +00009; RUN: grep bisl %t2.s | count 7
10; RUN: grep ilhu %t2.s | count 2
11; RUN: grep iohl %t2.s | count 2
Evan Cheng76ebe862009-12-09 01:53:58 +000012; RUN: grep rotqby %t2.s | count 5
Scott Michel48eef222008-12-09 06:12:03 +000013; RUN: grep lqd %t2.s | count 13
Rafael Espindola3a911192008-12-03 17:14:56 +000014; RUN: grep ilhu %t2.s | count 2
Evan Cheng76ebe862009-12-09 01:53:58 +000015; RUN: grep ai %t2.s | count 8
Scott Michel6965c382008-11-09 01:03:41 +000016; RUN: grep dispatch_tab %t2.s | count 6
Scott Michelabc58242008-01-11 21:01:19 +000017
Scott Micheldbac4cf2008-01-11 02:53:15 +000018; ModuleID = 'call_indirect.bc'
19target datalayout = "E-p:32:32:128-f64:64:128-f32:32:128-i64:32:128-i32:32:128-i16:16:128-i8:8:128-i1:8:128-a0:0:128-v128:128:128"
20target triple = "spu-unknown-elf"
21
22@dispatch_tab = global [6 x void (i32, float)*] zeroinitializer, align 16
23
24define void @dispatcher(i32 %i_arg, float %f_arg) {
25entry:
Scott Michele26d9a62008-03-05 23:00:19 +000026 %tmp2 = load void (i32, float)** getelementptr ([6 x void (i32, float)*]* @dispatch_tab, i32 0, i32 0), align 16
27 tail call void %tmp2( i32 %i_arg, float %f_arg )
28 %tmp2.1 = load void (i32, float)** getelementptr ([6 x void (i32, float)*]* @dispatch_tab, i32 0, i32 1), align 4
29 tail call void %tmp2.1( i32 %i_arg, float %f_arg )
30 %tmp2.2 = load void (i32, float)** getelementptr ([6 x void (i32, float)*]* @dispatch_tab, i32 0, i32 2), align 4
31 tail call void %tmp2.2( i32 %i_arg, float %f_arg )
32 %tmp2.3 = load void (i32, float)** getelementptr ([6 x void (i32, float)*]* @dispatch_tab, i32 0, i32 3), align 4
33 tail call void %tmp2.3( i32 %i_arg, float %f_arg )
34 %tmp2.4 = load void (i32, float)** getelementptr ([6 x void (i32, float)*]* @dispatch_tab, i32 0, i32 4), align 4
35 tail call void %tmp2.4( i32 %i_arg, float %f_arg )
36 %tmp2.5 = load void (i32, float)** getelementptr ([6 x void (i32, float)*]* @dispatch_tab, i32 0, i32 5), align 4
37 tail call void %tmp2.5( i32 %i_arg, float %f_arg )
38 ret void
Scott Micheldbac4cf2008-01-11 02:53:15 +000039}
Scott Michel394e26d2008-01-17 20:38:41 +000040
41@ptr_list = internal global [1 x void ()*] [ void ()* inttoptr (i64 4294967295 to void ()*) ], align 4
42@ptr.a = internal global void ()** getelementptr ([1 x void ()*]* @ptr_list, i32 0, i32 1), align 16
43
44define void @double_indirect_call() {
Scott Michele26d9a62008-03-05 23:00:19 +000045 %a = load void ()*** @ptr.a, align 16
46 %b = load void ()** %a, align 4
47 tail call void %b()
48 ret void
Scott Michel394e26d2008-01-17 20:38:41 +000049}