From bac4529b439715762f0ab717c382b331cf3286ad Mon Sep 17 00:00:00 2001 From: Mehdi Amini Date: Sat, 2 Oct 2021 23:53:02 +0000 Subject: [PATCH] Fix/disable more MLIR tests exposing leaks in ASAN builds (NFC) --- mlir/test/Examples/standalone/lit.local.cfg | 5 +++++ mlir/test/IR/invalid.mlir | 3 +++ mlir/test/IR/opaque_locations.mlir | 10 +++++----- mlir/test/Pass/crash-recovery.mlir | 3 +++ mlir/test/lib/IR/TestOpaqueLoc.cpp | 2 +- 5 files changed, 17 insertions(+), 6 deletions(-) diff --git a/mlir/test/Examples/standalone/lit.local.cfg b/mlir/test/Examples/standalone/lit.local.cfg index 2ec53bd..14950ec 100644 --- a/mlir/test/Examples/standalone/lit.local.cfg +++ b/mlir/test/Examples/standalone/lit.local.cfg @@ -1,3 +1,8 @@ +# Disable with sanitizers for now, this require some more setup apparently. +for san in ['asan', 'msan', 'ubsan']: + if (san in config.available_features): + config.unsupported = True + config.substitutions.append(("%cmake", config.host_cmake)) config.substitutions.append(("%host_cxx", config.host_cxx)) config.substitutions.append(("%host_cc", config.host_cc)) diff --git a/mlir/test/IR/invalid.mlir b/mlir/test/IR/invalid.mlir index 80b0fae..bbb87b4 100644 --- a/mlir/test/IR/invalid.mlir +++ b/mlir/test/IR/invalid.mlir @@ -1,5 +1,8 @@ // RUN: mlir-opt -allow-unregistered-dialect %s -split-input-file -verify-diagnostics +// See http://llvm.org/pr52045 +// UNSUPPORTED: asan + // Check different error cases. // ----- diff --git a/mlir/test/IR/opaque_locations.mlir b/mlir/test/IR/opaque_locations.mlir index 8d1dde8..54f3781 100644 --- a/mlir/test/IR/opaque_locations.mlir +++ b/mlir/test/IR/opaque_locations.mlir @@ -1,11 +1,11 @@ -// RUN: mlir-opt -allow-unregistered-dialect %s -test-opaque-loc -mlir-print-debuginfo -mlir-print-local-scope | FileCheck %s +// RUN: mlir-opt %s -test-opaque-loc -mlir-print-debuginfo -mlir-print-local-scope | FileCheck %s // This test verifies that debug opaque locations can be printed. #set0 = affine_set<(d0) : (1 == 0)> -// CHECK: MyLocation: 0: 'foo' op -// CHECK: nullptr: 'foo' op -// CHECK: MyLocation: 0: 'foo' op +// CHECK: MyLocation: 0: 'test.foo' op +// CHECK: nullptr: 'test.foo' op +// CHECK: MyLocation: 0: 'test.foo' op // CHECK: MyLocation: 1: 'std.constant' op // CHECK: nullptr: 'std.constant' op // CHECK: MyLocation: 1: 'std.constant' op @@ -15,7 +15,7 @@ func @inline_notation() -> i32 { // CHECK: -> i32 loc("foo") // CHECK: -> i32 loc("foo") // CHECK: -> i32 loc(unknown) - %1 = "foo"() : () -> i32 loc("foo") + %1 = "test.foo"() : () -> i32 loc("foo") // CHECK: constant 4 : index loc(callsite("foo" at "mysource.cc":10:8)) // CHECK: constant 4 : index loc(callsite("foo" at "mysource.cc":10:8)) diff --git a/mlir/test/Pass/crash-recovery.mlir b/mlir/test/Pass/crash-recovery.mlir index e7e0a77..31db0fd 100644 --- a/mlir/test/Pass/crash-recovery.mlir +++ b/mlir/test/Pass/crash-recovery.mlir @@ -11,6 +11,9 @@ // RUN: mlir-opt %s -pass-pipeline='test-module-pass,test-dynamic-pipeline{op-name=inner_mod1 run-on-nested-operations=1 dynamic-pipeline=test-pass-crash}' -pass-pipeline-crash-reproducer=%t -verify-diagnostics -pass-pipeline-local-reproducer --mlir-disable-threading // RUN: cat %t | FileCheck -check-prefix=REPRO_LOCAL_DYNAMIC %s +// The crash recovery mechanism will leak memory allocated in the crashing thread. +// UNSUPPORTED: asan + // expected-error@below {{Failures have been detected while processing an MLIR pass pipeline}} // expected-note@below {{Pipeline failed while executing}} module @inner_mod1 { diff --git a/mlir/test/lib/IR/TestOpaqueLoc.cpp b/mlir/test/lib/IR/TestOpaqueLoc.cpp index 39f5cfb..35d31a0 100644 --- a/mlir/test/lib/IR/TestOpaqueLoc.cpp +++ b/mlir/test/lib/IR/TestOpaqueLoc.cpp @@ -37,7 +37,7 @@ struct TestOpaqueLoc std::vector> myLocs; int last_it = 0; - getOperation().walk([&](Operation *op) { + getOperation().getBody()->walk([&](Operation *op) { myLocs.push_back(std::make_unique(last_it++)); Location loc = op->getLoc(); -- 2.7.4