2006-12-02 12:23:10 +08:00
|
|
|
; RUN: llvm-upgrade < %s | llvm-as | llvm-dis > %t1.ll
|
2004-11-07 14:08:43 +08:00
|
|
|
; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
|
|
|
|
; RUN: diff %t1.ll %t2.ll
|
|
|
|
|
2001-09-18 12:38:50 +08:00
|
|
|
%somestr = constant [11x sbyte] c"hello world"
|
2001-12-15 00:46:53 +08:00
|
|
|
%array = constant [2 x int] [ int 12, int 52 ]
|
2001-09-18 12:38:50 +08:00
|
|
|
constant { int, int } { int 4, int 3 }
|
|
|
|
|
|
|
|
implementation
|
|
|
|
|
2002-05-23 06:28:27 +08:00
|
|
|
[2 x int]* %testfunction(int %i0, int %j0)
|
2001-09-18 12:38:50 +08:00
|
|
|
begin
|
2001-12-15 00:46:53 +08:00
|
|
|
ret [2x int]* %array
|
2001-09-18 12:38:50 +08:00
|
|
|
end
|
|
|
|
|
2002-05-23 06:28:27 +08:00
|
|
|
sbyte* %otherfunc(int, double)
|
2001-09-18 12:38:50 +08:00
|
|
|
begin
|
2002-10-07 06:43:49 +08:00
|
|
|
%somestr = getelementptr [11x sbyte]* %somestr, long 0, long 0
|
2001-12-15 00:46:53 +08:00
|
|
|
ret sbyte* %somestr
|
2001-09-18 12:38:50 +08:00
|
|
|
end
|
|
|
|
|
2002-05-23 06:28:27 +08:00
|
|
|
sbyte* %yetanotherfunc(int, double)
|
2001-10-01 06:47:06 +08:00
|
|
|
begin
|
2001-12-15 00:46:53 +08:00
|
|
|
ret sbyte* null ; Test null
|
2001-09-18 12:38:50 +08:00
|
|
|
end
|
2001-10-01 06:47:06 +08:00
|
|
|
|
2006-12-21 01:27:58 +08:00
|
|
|
uint %negativeUnsigned() {
|
|
|
|
ret uint -1
|
|
|
|
}
|
|
|
|
|
|
|
|
int %largeSigned() {
|
|
|
|
ret int 3900000000
|
|
|
|
}
|