mirror of
https://github.com/RPCSX/llvm.git
synced 2024-11-24 12:19:53 +00:00
Add support for XFAILing valgrind runs with memory leak checking independently
of runs without leak checking. We add -vg to the triple for non-checked runs, or -vg_leak for checked runs. Also use this to XFAIL the TableGen tests, since tablegen leaks like a sieve. This includes some valgrindArgs refactoring. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99103 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
f2de13f8d7
commit
32989deb96
@ -1,4 +1,5 @@
|
||||
// RUN: tblgen %s
|
||||
// XFAIL: vg_leak
|
||||
|
||||
class test<code C> {
|
||||
code Code = C;
|
||||
|
@ -1,4 +1,5 @@
|
||||
// RUN: tblgen %s | grep -- 4294901760
|
||||
// XFAIL: vg_leak
|
||||
|
||||
def X {
|
||||
int Y = 0xFFFF0000;
|
||||
|
@ -1,4 +1,5 @@
|
||||
// RUN: tblgen < %s
|
||||
// XFAIL: vg_leak
|
||||
|
||||
class foo<int X> { int THEVAL = X; }
|
||||
def foo_imp : foo<1>;
|
||||
|
@ -1,5 +1,6 @@
|
||||
// RUN: tblgen %s | grep {dag d = (X Y)}
|
||||
// RUN: tblgen %s | grep {dag e = (Y X)}
|
||||
// XFAIL: vg_leak
|
||||
def X;
|
||||
|
||||
class yclass;
|
||||
|
@ -1,4 +1,5 @@
|
||||
// RUN: tblgen %s | grep {dag d = (X 13)}
|
||||
// XFAIL: vg_leak
|
||||
def X;
|
||||
|
||||
class C<int N> {
|
||||
|
@ -1,4 +1,5 @@
|
||||
// RUN: tblgen %s | grep {zing = 4} | count 4
|
||||
// XFAIL: vg_leak
|
||||
|
||||
class C1<int A, string B> {
|
||||
int bar = A;
|
||||
|
@ -1,4 +1,5 @@
|
||||
// RUN: tblgen %s -o -
|
||||
// XFAIL: vg_leak
|
||||
|
||||
class bar {
|
||||
list<bar> x;
|
||||
|
@ -1,4 +1,5 @@
|
||||
// RUN: tblgen %s
|
||||
// XFAIL: vg_leak
|
||||
//
|
||||
// Test to make sure that lists work with any data-type
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
// RUN: tblgen %s
|
||||
// XFAIL: vg_leak
|
||||
def {
|
||||
bit A = 1;
|
||||
int B = A;
|
||||
|
@ -1,5 +1,5 @@
|
||||
// RUN: tblgen %s | grep {int Y = 3}
|
||||
|
||||
// XFAIL: vg_leak
|
||||
|
||||
class C {
|
||||
int X = 4;
|
||||
|
@ -1,4 +1,5 @@
|
||||
// RUN: tblgen %s
|
||||
// XFAIL: vg_leak
|
||||
|
||||
class B<list<int> v> {
|
||||
list<int> vals = v;
|
||||
|
@ -1,4 +1,5 @@
|
||||
// RUN: tblgen %s
|
||||
// XFAIL: vg_leak
|
||||
|
||||
class B<int v> {
|
||||
int val = v;
|
||||
|
@ -1,4 +1,5 @@
|
||||
// RUN: tblgen %s
|
||||
// XFAIL: vg_leak
|
||||
class A;
|
||||
class B : A;
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
// RUN: tblgen %s
|
||||
// XFAIL: vg_leak
|
||||
|
||||
def A {
|
||||
list<int> B = [10, 20, 30, 4, 1, 1231, 20];
|
||||
|
@ -1,4 +1,5 @@
|
||||
// RUN: tblgen %s | grep {zing = 4} | count 2
|
||||
// XFAIL: vg_leak
|
||||
|
||||
class C1<int A, string B> {
|
||||
int bar = A;
|
||||
|
@ -1,4 +1,5 @@
|
||||
// RUN: tblgen %s | grep WorldHelloCC | count 1
|
||||
// XFAIL: vg_leak
|
||||
|
||||
class C<string n> {
|
||||
string name = n;
|
||||
|
@ -1,4 +1,5 @@
|
||||
// RUN: tblgen %s | grep {zing = 4} | count 28
|
||||
// XFAIL: vg_leak
|
||||
|
||||
class C1<int A, string B> {
|
||||
int bar = A;
|
||||
|
@ -1,5 +1,6 @@
|
||||
// RUN: tblgen %s | grep {\\\[(set} | count 2
|
||||
// RUN: tblgen %s | grep {\\\[\\\]} | count 2
|
||||
// XFAIL: vg_leak
|
||||
|
||||
class ValueType<int size, int value> {
|
||||
int Size = size;
|
||||
|
@ -1,4 +1,5 @@
|
||||
// RUN: tblgen %s
|
||||
// XFAIL: vg_leak
|
||||
class x {
|
||||
string y = "missing terminating '\"' character";
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
// RUN: tblgen < %s
|
||||
// XFAIL: vg_leak
|
||||
// Test for template arguments that have the same name as superclass template
|
||||
// arguments.
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
// This test describes how we eventually want to describe instructions in
|
||||
// the target independent code generators.
|
||||
// RUN: tblgen %s
|
||||
// XFAIL: vg_leak
|
||||
|
||||
// Target indep stuff.
|
||||
class Instruction { // Would have other stuff eventually
|
||||
|
@ -1,5 +1,6 @@
|
||||
// RUN: tblgen %s | grep {\\\[(set VR128:\$dst, (int_x86_sse2_add_pd VR128:\$src1, VR128:\$src2))\\\]} | count 1
|
||||
// RUN: tblgen %s | grep {\\\[(set VR128:\$dst, (int_x86_sse2_add_ps VR128:\$src1, VR128:\$src2))\\\]} | count 1
|
||||
// XFAIL: vg_leak
|
||||
|
||||
class ValueType<int size, int value> {
|
||||
int Size = size;
|
||||
|
@ -1,4 +1,5 @@
|
||||
// RUN: tblgen %s
|
||||
// XFAIL: vg_leak
|
||||
|
||||
// Make sure there is no collision between XX and XX.
|
||||
def S;
|
||||
|
@ -1,5 +1,6 @@
|
||||
// This tests to make sure we can parse tree patterns.
|
||||
// RUN: tblgen %s
|
||||
// XFAIL: vg_leak
|
||||
|
||||
class TreeNode;
|
||||
class RegisterClass;
|
||||
|
@ -1,5 +1,6 @@
|
||||
// This tests to make sure we can parse tree patterns with names.
|
||||
// RUN: tblgen %s
|
||||
// XFAIL: vg_leak
|
||||
|
||||
class TreeNode;
|
||||
class RegisterClass;
|
||||
|
@ -1,4 +1,5 @@
|
||||
// RUN: tblgen %s
|
||||
// XFAIL: vg_leak
|
||||
class x {
|
||||
field bits<32> A;
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
// RUN: tblgen %s | grep {add_ps} | count 3
|
||||
// XFAIL: vg_leak
|
||||
|
||||
class ValueType<int size, int value> {
|
||||
int Size = size;
|
||||
|
@ -1,4 +1,5 @@
|
||||
// RUN: tblgen %s | FileCheck %s
|
||||
// XFAIL: vg_leak
|
||||
// CHECK: Value = 0
|
||||
// CHECK: Value = 1
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
// RUN: tblgen %s | grep {Jr} | count 2
|
||||
// RUN: tblgen %s | grep {Sr} | count 2
|
||||
// RUN: tblgen %s | grep {NAME} | count 1
|
||||
// XFAIL: vg_leak
|
||||
|
||||
// Variables for foreach
|
||||
class decls {
|
||||
|
@ -1,5 +1,6 @@
|
||||
// RUN: tblgen %s | grep {\\\[1, 2, 3\\\]} | count 4
|
||||
// RUN: tblgen %s | grep {\\\[4, 5, 6\\\]} | count 2
|
||||
// XFAIL: vg_leak
|
||||
|
||||
class A<list<list<int>> vals> {
|
||||
list<int> first = vals[0];
|
||||
|
@ -1,4 +1,5 @@
|
||||
// RUN: tblgen %s | grep {}
|
||||
// XFAIL: vg_leak
|
||||
|
||||
class List<list<string> n> {
|
||||
list<string> names = n;
|
||||
|
@ -1,4 +1,5 @@
|
||||
// RUN: tblgen %s | grep {add_ps} | count 3
|
||||
// XFAIL: vg_leak
|
||||
|
||||
class ValueType<int size, int value> {
|
||||
int Size = size;
|
||||
|
@ -1,4 +1,5 @@
|
||||
// RUN: tblgen %s | grep fufoo
|
||||
// XFAIL: vg_leak
|
||||
|
||||
class Y<string S> {
|
||||
string T = !strconcat(S, "foo");
|
||||
|
@ -4,6 +4,7 @@
|
||||
// RUN: tblgen %s | grep {LAST} | count 1
|
||||
// RUN: tblgen %s | grep {TVAR} | count 2
|
||||
// RUN: tblgen %s | grep {Bogus} | count 1
|
||||
// XFAIL: vg_leak
|
||||
|
||||
class Honorific<string t> {
|
||||
string honorific = t;
|
||||
|
@ -1,4 +1,5 @@
|
||||
// RUN: tblgen %s | FileCheck %s
|
||||
// XFAIL: vg_leak
|
||||
// CHECK: No subst
|
||||
// CHECK: No foo
|
||||
// CHECK: RECURSE foo
|
||||
|
@ -128,10 +128,9 @@ excludes = []
|
||||
# Provide target_triple for use in XFAIL and XTARGET.
|
||||
config.target_triple = site_exp['target_triplet']
|
||||
|
||||
# When running under valgrind, we mangle '-vg' onto the end of the triple so we
|
||||
# can check it with XFAIL and XTARGET.
|
||||
if lit.useValgrind:
|
||||
config.target_triple += '-vg'
|
||||
# When running under valgrind, we mangle '-vg' or '-vg_leak' onto the end of the
|
||||
# triple so we can check it with XFAIL and XTARGET.
|
||||
config.target_triple += lit.valgrindTriple
|
||||
|
||||
# Provide llvm_supports_target for use in local configs.
|
||||
targets = set(site_exp["TARGETS_TO_BUILD"].split())
|
||||
|
@ -15,7 +15,7 @@ class LitConfig:
|
||||
import Util as util
|
||||
|
||||
def __init__(self, progname, path, quiet,
|
||||
useValgrind, valgrindArgs,
|
||||
useValgrind, valgrindLeakCheck, valgrindArgs,
|
||||
useTclAsSh,
|
||||
noExecute, debug, isWindows,
|
||||
params):
|
||||
@ -25,7 +25,8 @@ class LitConfig:
|
||||
self.path = list(map(str, path))
|
||||
self.quiet = bool(quiet)
|
||||
self.useValgrind = bool(useValgrind)
|
||||
self.valgrindArgs = list(valgrindArgs)
|
||||
self.valgrindLeakCheck = bool(valgrindLeakCheck)
|
||||
self.valgrindUserArgs = list(valgrindArgs)
|
||||
self.useTclAsSh = bool(useTclAsSh)
|
||||
self.noExecute = noExecute
|
||||
self.debug = debug
|
||||
@ -36,6 +37,19 @@ class LitConfig:
|
||||
self.numErrors = 0
|
||||
self.numWarnings = 0
|
||||
|
||||
self.valgrindArgs = []
|
||||
self.valgrindTriple = ""
|
||||
if self.useValgrind:
|
||||
self.valgrindTriple = "-vg"
|
||||
self.valgrindArgs = ['valgrind', '-q', '--run-libc-freeres=no',
|
||||
'--tool=memcheck', '--trace-children=yes',
|
||||
'--error-exitcode=123']
|
||||
if self.valgrindLeakCheck:
|
||||
self.valgrindTriple += "_leak"
|
||||
self.valgrindArgs.append('--leak-check=full')
|
||||
self.valgrindArgs.extend(self.valgrindUserArgs)
|
||||
|
||||
|
||||
def load_config(self, config, path):
|
||||
"""load_config(config, path) - Load a config object from an alternate
|
||||
path."""
|
||||
|
@ -73,12 +73,7 @@ class GoogleTest(object):
|
||||
|
||||
cmd = [testPath, '--gtest_filter=' + testName]
|
||||
if litConfig.useValgrind:
|
||||
valgrindArgs = ['valgrind', '-q', '--run-libc-freeres=no',
|
||||
'--tool=memcheck', '--trace-children=yes',
|
||||
'--error-exitcode=123']
|
||||
valgrindArgs.extend(litConfig.valgrindArgs)
|
||||
|
||||
cmd = valgrindArgs + cmd
|
||||
cmd = litConfig.valgrindArgs + cmd
|
||||
|
||||
out, err, exitCode = TestRunner.executeCommand(
|
||||
cmd, env=test.config.environment)
|
||||
|
@ -253,16 +253,12 @@ def executeTclScriptInternal(test, litConfig, tmpBase, commands, cwd):
|
||||
return (Test.FAIL, "Tcl 'exec' parse error on: %r" % ln)
|
||||
|
||||
if litConfig.useValgrind:
|
||||
valgrindArgs = ['valgrind', '-q', '--run-libc-freeres=no',
|
||||
'--tool=memcheck', '--trace-children=yes',
|
||||
'--error-exitcode=123']
|
||||
valgrindArgs.extend(litConfig.valgrindArgs)
|
||||
for pipeline in cmds:
|
||||
if pipeline.commands:
|
||||
# Only valgrind the first command in each pipeline, to avoid
|
||||
# valgrinding things like grep, not, and FileCheck.
|
||||
cmd = pipeline.commands[0]
|
||||
cmd.args = valgrindArgs + cmd.args
|
||||
cmd.args = litConfig.valgrindArgs + cmd.args
|
||||
|
||||
cmd = cmds[0]
|
||||
for c in cmds[1:]:
|
||||
@ -339,12 +335,7 @@ def executeScript(test, litConfig, tmpBase, commands, cwd):
|
||||
if litConfig.useValgrind:
|
||||
# FIXME: Running valgrind on sh is overkill. We probably could just
|
||||
# run on clang with no real loss.
|
||||
valgrindArgs = ['valgrind', '-q', '--run-libc-freeres=no',
|
||||
'--tool=memcheck', '--trace-children=yes',
|
||||
'--error-exitcode=123']
|
||||
valgrindArgs.extend(litConfig.valgrindArgs)
|
||||
|
||||
command = valgrindArgs + command
|
||||
command = litConfig.valgrindArgs + command
|
||||
|
||||
return executeCommand(command, cwd=cwd, env=test.config.environment)
|
||||
|
||||
|
@ -362,6 +362,9 @@ def main():
|
||||
group.add_option("", "--vg", dest="useValgrind",
|
||||
help="Run tests under valgrind",
|
||||
action="store_true", default=False)
|
||||
group.add_option("", "--vg-leak", dest="valgrindLeakCheck",
|
||||
help="Check for memory leaks under valgrind",
|
||||
action="store_true", default=False)
|
||||
group.add_option("", "--vg-arg", dest="valgrindArgs", metavar="ARG",
|
||||
help="Specify an extra argument for valgrind",
|
||||
type=str, action="append", default=[])
|
||||
@ -436,6 +439,7 @@ def main():
|
||||
path = opts.path,
|
||||
quiet = opts.quiet,
|
||||
useValgrind = opts.useValgrind,
|
||||
valgrindLeakCheck = opts.valgrindLeakCheck,
|
||||
valgrindArgs = opts.valgrindArgs,
|
||||
useTclAsSh = opts.useTclAsSh,
|
||||
noExecute = opts.noExecute,
|
||||
|
Loading…
Reference in New Issue
Block a user