mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-11-01 15:11:24 +00:00
5a70dd1d82
Similar to gep (r230786) and load (r230794) changes. Similar migration script can be used to update test cases, which successfully migrated all of LLVM and Polly, but about 4 test cases needed manually changes in Clang. (this script will read the contents of stdin and massage it into stdout - wrap it in the 'apply.sh' script shown in previous commits + xargs to apply it over a large set of test cases) import fileinput import sys import re rep = re.compile(r"(getelementptr(?:\s+inbounds)?\s*\()((<\d*\s+x\s+)?([^@]*?)(|\s*addrspace\(\d+\))\s*\*(?(3)>)\s*)(?=$|%|@|null|undef|blockaddress|getelementptr|addrspacecast|bitcast|inttoptr|zeroinitializer|<|\[\[[a-zA-Z]|\{\{)", re.MULTILINE | re.DOTALL) def conv(match): line = match.group(1) line += match.group(4) line += ", " line += match.group(2) return line line = sys.stdin.read() off = 0 for match in re.finditer(rep, line): sys.stdout.write(line[off:match.start()]) sys.stdout.write(conv(match)) off = match.end() sys.stdout.write(line[off:]) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232184 91177308-0d34-0410-b5e6-96231b3b80d8
33 lines
1.6 KiB
LLVM
33 lines
1.6 KiB
LLVM
; RUN: llc < %s
|
|
|
|
; On this code, llc did not pass the sixth argument (%reg321) to printf.
|
|
; It passed the first five in %o0 - %o4, but never initialized %o5.
|
|
@.LC12 = internal global [44 x i8] c"\09\09M = %g, I = %g, V = %g\0A\09\09O = %g, E = %g\0A\0A\00" ; <[44 x i8]*> [#uses=1]
|
|
|
|
declare i32 @printf(i8*, ...)
|
|
|
|
declare double @opaque(double)
|
|
|
|
define i32 @main(i32 %argc, i8** %argv) {
|
|
bb25:
|
|
%b = icmp sle i32 %argc, 2 ; <i1> [#uses=1]
|
|
br i1 %b, label %bb42, label %bb43
|
|
|
|
bb42: ; preds = %bb25
|
|
%reg315 = call double @opaque( double 3.000000e+00 ) ; <double> [#uses=1]
|
|
%reg316 = call double @opaque( double 3.100000e+00 ) ; <double> [#uses=1]
|
|
%reg317 = call double @opaque( double 3.200000e+00 ) ; <double> [#uses=1]
|
|
%reg318 = call double @opaque( double 3.300000e+00 ) ; <double> [#uses=1]
|
|
%reg319 = call double @opaque( double 3.400000e+00 ) ; <double> [#uses=1]
|
|
br label %bb43
|
|
|
|
bb43: ; preds = %bb42, %bb25
|
|
%reg321 = phi double [ 2.000000e-01, %bb25 ], [ %reg315, %bb42 ] ; <double> [#uses=1]
|
|
%reg322 = phi double [ 6.000000e+00, %bb25 ], [ %reg316, %bb42 ] ; <double> [#uses=1]
|
|
%reg323 = phi double [ -1.000000e+00, %bb25 ], [ %reg317, %bb42 ] ; <double> [#uses=1]
|
|
%reg324 = phi double [ -1.000000e+00, %bb25 ], [ %reg318, %bb42 ] ; <double> [#uses=1]
|
|
%reg325 = phi double [ 1.000000e+00, %bb25 ], [ %reg319, %bb42 ] ; <double> [#uses=1]
|
|
%reg609 = call i32 (i8*, ...)* @printf( i8* getelementptr ([44 x i8], [44 x i8]* @.LC12, i64 0, i64 0), double %reg325, double %reg324, double %reg323, double %reg322, double %reg321 ) ; <i32> [#uses=0]
|
|
ret i32 0
|
|
}
|