1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-linux-gnu < %s \
3 ; RUN: 2>&1 | FileCheck --check-prefix=CHECK-LE %s
4 ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-ibm-aix-xcoff < %s \
5 ; RUN: 2>&1 | FileCheck --check-prefix=CHECK-BE %s
7 %0 = type <{ i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, ptr, [8 x i8] }>
8 @global.1 = internal global %0 <{ i32 129, i32 2, i32 118, i32 0, i32 5, i32 0, i32 0, i32 0, i32 120, i32 0, ptr @global.2, [8 x i8] c"\00\00\00\00\00\00\00\03" }>, align 4
9 @global.2 = internal constant [3 x i8] c"x.c"
10 @alias = dso_local alias i32 (), ptr @main
12 define dso_local signext i32 @main() nounwind {
13 ; CHECK-LE-LABEL: main:
14 ; CHECK-LE: # %bb.0: # %bb
15 ; CHECK-LE-NEXT: mflr 0
16 ; CHECK-LE-NEXT: std 0, 16(1)
17 ; CHECK-LE-NEXT: lis 0, -1
18 ; CHECK-LE-NEXT: ori 0, 0, 65535
19 ; CHECK-LE-NEXT: sldi 0, 0, 32
20 ; CHECK-LE-NEXT: oris 0, 0, 32767
21 ; CHECK-LE-NEXT: ori 0, 0, 65120
22 ; CHECK-LE-NEXT: stdux 1, 1, 0
23 ; CHECK-LE-NEXT: lis 3, 0
24 ; CHECK-LE-NEXT: sldi 3, 3, 32
25 ; CHECK-LE-NEXT: oris 3, 3, 32768
26 ; CHECK-LE-NEXT: ori 3, 3, 400
27 ; CHECK-LE-NEXT: stdx 30, 1, 3 # 8-byte Folded Spill
28 ; CHECK-LE-NEXT: bl pluto
30 ; CHECK-LE-NEXT: addis 3, 2, global.1@toc@ha
31 ; CHECK-LE-NEXT: li 4, 257
32 ; CHECK-LE-NEXT: li 7, 0
33 ; CHECK-LE-NEXT: li 8, 0
34 ; CHECK-LE-NEXT: li 9, 0
35 ; CHECK-LE-NEXT: addi 5, 3, global.1@toc@l
36 ; CHECK-LE-NEXT: li 3, 0
37 ; CHECK-LE-NEXT: ori 6, 3, 32768
38 ; CHECK-LE-NEXT: li 3, 6
39 ; CHECK-LE-NEXT: bl snork
41 ; CHECK-LE-NEXT: mr 30, 3
42 ; CHECK-LE-NEXT: li 3, 344
43 ; CHECK-LE-NEXT: addi 4, 1, 48
44 ; CHECK-LE-NEXT: li 5, 8
45 ; CHECK-LE-NEXT: li 6, 8
46 ; CHECK-LE-NEXT: oris 3, 3, 32768
47 ; CHECK-LE-NEXT: add 4, 4, 3
48 ; CHECK-LE-NEXT: mr 3, 30
49 ; CHECK-LE-NEXT: bl zot
51 ; CHECK-LE-NEXT: mr 3, 30
52 ; CHECK-LE-NEXT: bl wibble
54 ; CHECK-LE-NEXT: li 3, 0
55 ; CHECK-LE-NEXT: bl snork.3
58 ; CHECK-BE-LABEL: main:
59 ; CHECK-BE: # %bb.0: # %bb
60 ; CHECK-BE-NEXT: mflr 0
61 ; CHECK-BE-NEXT: std 0, 16(1)
62 ; CHECK-BE-NEXT: lis 0, -1
63 ; CHECK-BE-NEXT: ori 0, 0, 65535
64 ; CHECK-BE-NEXT: sldi 0, 0, 32
65 ; CHECK-BE-NEXT: oris 0, 0, 32767
66 ; CHECK-BE-NEXT: ori 0, 0, 65056
67 ; CHECK-BE-NEXT: stdux 1, 1, 0
68 ; CHECK-BE-NEXT: lis 3, 0
69 ; CHECK-BE-NEXT: sldi 3, 3, 32
70 ; CHECK-BE-NEXT: oris 3, 3, 32768
71 ; CHECK-BE-NEXT: ori 3, 3, 472
72 ; CHECK-BE-NEXT: stdx 31, 1, 3 # 8-byte Folded Spill
73 ; CHECK-BE-NEXT: bl .pluto[PR]
75 ; CHECK-BE-NEXT: ld 5, L..C0(2) # @global.1
76 ; CHECK-BE-NEXT: li 3, 0
77 ; CHECK-BE-NEXT: ori 6, 3, 32768
78 ; CHECK-BE-NEXT: li 3, 6
79 ; CHECK-BE-NEXT: li 4, 257
80 ; CHECK-BE-NEXT: li 7, 0
81 ; CHECK-BE-NEXT: li 8, 0
82 ; CHECK-BE-NEXT: li 9, 0
83 ; CHECK-BE-NEXT: bl .snork[PR]
85 ; CHECK-BE-NEXT: mr 31, 3
86 ; CHECK-BE-NEXT: li 3, 344
87 ; CHECK-BE-NEXT: oris 3, 3, 32768
88 ; CHECK-BE-NEXT: addi 4, 1, 120
89 ; CHECK-BE-NEXT: add 4, 4, 3
90 ; CHECK-BE-NEXT: mr 3, 31
91 ; CHECK-BE-NEXT: li 5, 8
92 ; CHECK-BE-NEXT: li 6, 8
93 ; CHECK-BE-NEXT: bl .zot[PR]
95 ; CHECK-BE-NEXT: mr 3, 31
96 ; CHECK-BE-NEXT: bl .wibble[PR]
98 ; CHECK-BE-NEXT: li 3, 0
99 ; CHECK-BE-NEXT: bl .snork.3[PR]
102 %tmp = alloca [2147484000 x i8], align 8
103 tail call void @pluto()
104 %tmp6 = tail call i64 @snork(i64 6, i32 257, ptr nonnull @global.1, i64 32768, ptr null, i64 0, ptr null)
105 %tmp7 = getelementptr inbounds [2147484000 x i8], ptr %tmp, i64 0, i64 2147483992
106 %tmp9 = call i64 @zot(i64 %tmp6, ptr nonnull %tmp7, i64 8, i64 8)
107 %tmp10 = call i64 @wibble(i64 %tmp6)
108 call void @snork.3(i64 0)
112 declare void @pluto()
114 declare signext i64 @snork(i64, i32, ptr, i64, ptr, i64, ptr)
116 declare signext i64 @zot(i64, ptr, i64, i64)
118 declare signext i64 @wibble(i64)
120 declare void @snork.3(i64)