blob: 7d9e11964e31c330df17c4c29f8859f317285765 [file] [log] [blame]
Reid Spencer69ccadd2006-12-02 04:23:10 +00001; RUN: llvm-upgrade < %s | llvm-as | llvm-dis > %t1.ll
Tanya Lattner3f7706b2004-11-07 06:08:43 +00002; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
3; RUN: diff %t1.ll %t2.ll
4
Chris Lattneread19d52001-09-18 04:38:50 +00005%somestr = constant [11x sbyte] c"hello world"
Chris Lattnerf493a562001-12-14 16:46:53 +00006%array = constant [2 x int] [ int 12, int 52 ]
Chris Lattneread19d52001-09-18 04:38:50 +00007 constant { int, int } { int 4, int 3 }
8
9implementation
10
Chris Lattner740d3cd2002-05-22 22:28:27 +000011[2 x int]* %testfunction(int %i0, int %j0)
Chris Lattneread19d52001-09-18 04:38:50 +000012begin
Chris Lattnerf493a562001-12-14 16:46:53 +000013 ret [2x int]* %array
Chris Lattneread19d52001-09-18 04:38:50 +000014end
15
Chris Lattner740d3cd2002-05-22 22:28:27 +000016sbyte* %otherfunc(int, double)
Chris Lattneread19d52001-09-18 04:38:50 +000017begin
Chris Lattner7209bff2002-10-06 22:43:49 +000018 %somestr = getelementptr [11x sbyte]* %somestr, long 0, long 0
Chris Lattnerf493a562001-12-14 16:46:53 +000019 ret sbyte* %somestr
Chris Lattneread19d52001-09-18 04:38:50 +000020end
21
Chris Lattner740d3cd2002-05-22 22:28:27 +000022sbyte* %yetanotherfunc(int, double)
Chris Lattner6b129362001-09-30 22:47:06 +000023begin
Chris Lattnerf493a562001-12-14 16:46:53 +000024 ret sbyte* null ; Test null
Chris Lattneread19d52001-09-18 04:38:50 +000025end
Chris Lattner6b129362001-09-30 22:47:06 +000026
Reid Spencer505811e2006-12-20 17:27:58 +000027uint %negativeUnsigned() {
28 ret uint -1
29}
30
31int %largeSigned() {
32 ret int 3900000000
33}