summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFangrui Song <maskray@google.com>2018-09-28 04:20:08 +0000
committerFangrui Song <maskray@google.com>2018-09-28 04:20:08 +0000
commit13a6750c2e76991723c8aa9c48c37fb0a7e3a8d0 (patch)
tree04175cc5fa88e6615ed40a444e489440f459348e
parentbb50c38635684a95979437c6ea511253ea843c1a (diff)
downloadbcm5719-llvm-13a6750c2e76991723c8aa9c48c37fb0a7e3a8d0.tar.gz
bcm5719-llvm-13a6750c2e76991723c8aa9c48c37fb0a7e3a8d0.zip
[XRay] Fix fdr-thread-order.cc when current directory contains fdr-thread-order.cc
Summary: Currently, cd test/xray/TestCases/Posix $build/bin/llvm-lit fdr-thread-order.cc fails because `rm fdr-thread-order.*` deletes the .cc file. This patch uses: * %t as temporary directory name containing log files * %t.exe as executable name It does not delete %t after the test finishes for debugging convenience. This matches the behavior of tests of various other LLVM components. Log files will not clog up because the temporary directory (unique among test files but the same among multiple invocations of a test) is cleaned at the beginning of the test. Reviewers: dberris, mboerger, eizan Reviewed By: dberris Subscribers: delcypher, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D52638 llvm-svn: 343295
-rw-r--r--compiler-rt/test/xray/TestCases/Posix/fdr-thread-order.cc19
1 files changed, 8 insertions, 11 deletions
diff --git a/compiler-rt/test/xray/TestCases/Posix/fdr-thread-order.cc b/compiler-rt/test/xray/TestCases/Posix/fdr-thread-order.cc
index 9e03063d324..a5d7e6f36e1 100644
--- a/compiler-rt/test/xray/TestCases/Posix/fdr-thread-order.cc
+++ b/compiler-rt/test/xray/TestCases/Posix/fdr-thread-order.cc
@@ -1,15 +1,12 @@
-// RUN: %clangxx_xray -g -std=c++11 %s -o %t
-// RUN: rm fdr-thread-order.* || true
-// RUN: XRAY_OPTIONS="patch_premain=false xray_naive_log=false \
-// RUN: xray_logfile_base=fdr-thread-order. xray_fdr_log=true verbosity=1 \
-// RUN: xray_fdr_log_func_duration_threshold_us=0" %run %t 2>&1 | \
+// RUN: rm -rf %t && mkdir %t
+// RUN: %clangxx_xray -g -std=c++11 %s -o %t.exe
+// RUN: XRAY_OPTIONS="patch_premain=false \
+// RUN: xray_logfile_base=%t/ xray_mode=xray-fdr verbosity=1" \
+// RUN: XRAY_FDR_OPTIONS=func_duration_threshold_us=0 %run %t.exe 2>&1 | \
// RUN: FileCheck %s
-// RUN: %llvm_xray convert --symbolize --output-format=yaml -instr_map=%t \
-// RUN: "`ls fdr-thread-order.* | head -1`"
-// RUN: %llvm_xray convert --symbolize --output-format=yaml -instr_map=%t \
-// RUN: "`ls fdr-thread-order.* | head -1`" | \
-// RUN: FileCheck %s --check-prefix TRACE
-// RUN: rm fdr-thread-order.*
+// RUN: %llvm_xray convert --symbolize --output-format=yaml -instr_map=%t.exe %t/*
+// RUN: %llvm_xray convert --symbolize --output-format=yaml -instr_map=%t.exe %t/* | \
+// RUN: FileCheck %s --check-prefix TRACE
// FIXME: Make llvm-xray work on non-x86_64 as well.
// REQUIRES: x86_64-target-arch
// REQUIRES: built-in-llvm-tree
OpenPOWER on IntegriCloud