summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorKathy Gray2014-10-27 18:02:03 +0000
committerKathy Gray2014-10-27 18:02:03 +0000
commitdcc835cc3979ca2b07c2bff50bfa7928eab8681c (patch)
treec1d139244ae4c85a9848530843767103828d6d5f /src/test
parentc4bf668b018868e28c286e9aeb931deba2f5657c (diff)
source and assembly of test hello4
Diffstat (limited to 'src/test')
-rw-r--r--src/test/hello4.c11
-rw-r--r--src/test/hello4.s53
2 files changed, 64 insertions, 0 deletions
diff --git a/src/test/hello4.c b/src/test/hello4.c
new file mode 100644
index 00000000..849e7a8d
--- /dev/null
+++ b/src/test/hello4.c
@@ -0,0 +1,11 @@
+int main() {
+ int x = 6;
+ int y = 7;
+ int z = 0;
+ if ((x * y) > (x - y)) {
+ z = x * y;
+ } else {
+ z = x - y;
+ }
+ return z;
+}
diff --git a/src/test/hello4.s b/src/test/hello4.s
new file mode 100644
index 00000000..4c7100d6
--- /dev/null
+++ b/src/test/hello4.s
@@ -0,0 +1,53 @@
+ .file "hello4.c"
+ .section ".toc","aw"
+ .section ".text"
+ .align 2
+ .globl main
+ .section ".opd","aw"
+ .align 3
+main:
+ .quad .L.main,.TOC.@tocbase
+ .previous
+ .type main, @function
+.L.main:
+ std 31,-8(1)
+ stdu 1,-80(1)
+ mr 31,1
+ li 0,6
+ stw 0,56(31)
+ li 0,7
+ stw 0,52(31)
+ li 0,0
+ stw 0,48(31)
+ lwz 9,56(31)
+ lwz 0,52(31)
+ mullw 0,9,0
+ extsw 9,0
+ lwz 11,56(31)
+ lwz 0,52(31)
+ subf 0,0,11
+ extsw 0,0
+ cmpw 7,9,0
+ ble 7,.L2
+ lwz 9,56(31)
+ lwz 0,52(31)
+ mullw 0,9,0
+ stw 0,48(31)
+ b .L3
+.L2:
+ lwz 9,56(31)
+ lwz 0,52(31)
+ subf 0,0,9
+ stw 0,48(31)
+.L3:
+ lwz 0,48(31)
+ extsw 0,0
+ mr 3,0
+ addi 1,31,80
+ ld 31,-8(1)
+ blr
+ .long 0
+ .byte 0,0,0,0,128,1,0,1
+ .size main,.-.L.main
+ .ident "GCC: (GNU) 4.4.7 20120313 (Red Hat 4.4.7-3)"
+ .section .note.GNU-stack,"",@progbits