Skip to content

Commit

Permalink
[Driver][test] Clean up some xray tests
Browse files Browse the repository at this point in the history
Add explicit --target= so that the tests run on all targets, not some
that support XRay, similar to commit e105141.
For option testing, we often use a placeholder architecture (e.g., x86_64).

Fix #64028
  • Loading branch information
MaskRay committed Jul 24, 2023
1 parent f617aaa commit 841ff7c
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 67 deletions.
5 changes: 1 addition & 4 deletions clang/test/Driver/XRay/xray-ignore-loops-flags.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,5 @@
// options include the -fxray-ignore-loops flag we provide in the
// invocation.
//
// RUN: %clang -fxray-instrument -fxray-ignore-loops -target x86_64-linux- -### \
// RUN: -x c++ -emit-llvm -c -o - %s 2>&1 | FileCheck %s
// RUN: %clang -### -c --target=x86_64 -fxray-ignore-loops %s 2>&1 | FileCheck %s
// CHECK: -fxray-ignore-loops
//
// REQUIRES: x86_64 || x86_64h
8 changes: 2 additions & 6 deletions clang/test/Driver/XRay/xray-instrumentation-bundles-flags.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,5 @@
// options include the -fxray-instrumentation-bundle= flag we provide in the
// invocation.
//
// RUN: %clang -fxray-instrument -fxray-instrumentation-bundle=function -### \
// RUN: -c -o - %s 2>&1 | FileCheck %s
// CHECK: -fxray-instrumentation-bundle=function
//
// REQUIRES: linux || freebsd
// REQUIRES: amd64 || x86_64 || x86_64h || arm || aarch64 || arm64
// RUN: %clang -### -c --target=aarch64 -fxray-instrument -fxray-instrumentation-bundle=function %s 2>&1 | FileCheck %s
// CHECK: "-fxray-instrumentation-bundle=function"
64 changes: 23 additions & 41 deletions clang/test/Driver/XRay/xray-mode-flags.cpp
Original file line number Diff line number Diff line change
@@ -1,49 +1,31 @@
// RUN: %clang -v -o /dev/null -fxray-instrument -fxray-modes=xray-fdr %s -### \
// RUN: 2>&1 | FileCheck --check-prefix FDR %s
// RUN: %clang -v -o /dev/null -fxray-instrument -fxray-modes=xray-basic %s \
// RUN: -### 2>&1 | FileCheck --check-prefix BASIC %s
// RUN: %clang -v -o /dev/null -fxray-instrument -fxray-modes=all -### %s \
// RUN: 2>&1 | FileCheck --check-prefixes FDR,BASIC %s
// RUN: %clang -v -o /dev/null -fxray-instrument \
// RUN: -fxray-modes=xray-fdr,xray-basic -### %s 2>&1 | \
// RUN: FileCheck --check-prefixes FDR,BASIC %s
// RUN: %clang -v -o /dev/null -fxray-instrument \
// RUN: -fxray-modes=xray-fdr -fxray-modes=xray-basic -### %s 2>&1 | \
// RUN: FileCheck --check-prefixes FDR,BASIC %s
// RUN: %clang -v -o /dev/null -fxray-instrument -### %s \
// RUN: 2>&1 | FileCheck --check-prefixes FDR,BASIC %s
// RUN: %clang -v -o /dev/null -fxray-instrument -fxray-modes=none -### %s \
// RUN: 2>&1 | FileCheck --check-prefixes NONE %s
// RUN: %clang -### --target=x86_64-linux-gnu -fxray-instrument -fxray-modes=xray-fdr %s 2>&1 \
// RUN: | FileCheck --check-prefix=FDR %s
// RUN: %clang -### --target=aarch64-linux-gnu -fxray-instrument -fxray-modes=xray-basic %s 2>&1 \
// RUN: | FileCheck --check-prefix=BASIC %s
// RUN: %clang -### --target=aarch64-linux-gnu -fxray-instrument %s 2>&1 \
// RUN: | FileCheck --check-prefixes=FDR,BASIC %s
// RUN: %clang -### --target=x86_64-linux-gnu -fxray-instrument -fxray-modes=all %s 2>&1 \
// RUN: | FileCheck --check-prefixes=FDR,BASIC %s
// RUN: %clang -### --target=x86_64-linux-gnu -fxray-instrument -fxray-modes=xray-fdr,xray-basic %s 2>&1 \
// RUN: | FileCheck --check-prefixes=FDR,BASIC %s
// RUN: %clang -### --target=x86_64-linux-gnu -fxray-instrument -fxray-modes=xray-fdr -fxray-modes=xray-basic %s 2>&1 \
// RUN: | FileCheck --check-prefixes=FDR,BASIC %s
// RUN: %clang -### --target=x86_64-linux-gnu -fxray-instrument -fxray-modes=none %s 2>&1 \
// RUN: | FileCheck --check-prefix=NONE %s
//
// We also should support overriding the modes in an additive manner.
//
// RUN: %clang -v -o /dev/null -fxray-instrument -fxray-modes=none,xray-fdr \
// RUN: -### %s \
// RUN: 2>&1 | FileCheck --check-prefixes FDR %s
// RUN: %clang -v -o /dev/null -fxray-instrument -fxray-modes=xray-fdr,none \
// RUN: -### %s \
// RUN: 2>&1 | FileCheck --check-prefixes NONE %s
// RUN: %clang -v -o /dev/null -fxray-instrument -fxray-modes=none,all \
// RUN: -### %s \
// RUN: 2>&1 | FileCheck --check-prefixes FDR,BASIC %s
//

// RUN: %clang -### --target=x86_64-linux-gnu -fxray-instrument -fxray-modes=none,xray-fdr %s 2>&1 \
// RUN: | FileCheck --check-prefix=FDR %s
// RUN: %clang -### --target=x86_64-linux-gnu -fxray-instrument -fxray-modes=all,none %s 2>&1 \
// RUN: | FileCheck --check-prefix=NONE %s

// We also should support having the individual modes be concatenated.
//
// RUN: %clang -v -o /dev/null -fxray-instrument -fxray-modes=none \
// RUN: -fxray-modes=xray-fdr \
// RUN: -### %s \
// RUN: 2>&1 | FileCheck --check-prefixes FDR %s
//
// Order also matters.
//
// RUN: %clang -v -o /dev/null -fxray-instrument -fxray-modes=xray-fdr \
// RUN: -fxray-modes=none \
// RUN: -### %s \
// RUN: 2>&1 | FileCheck --check-prefixes NONE %s

// RUN: %clang -### --target=x86_64-linux-gnu -fxray-instrument -fxray-modes=none -fxray-modes=xray-fdr %s 2>&1 \
// RUN: | FileCheck --check-prefix=FDR %s

// BASIC: libclang_rt.xray-basic
// FDR: libclang_rt.xray-fdr
// NONE-NOT: libclang_rt.xray-basic
// NONE-NOT: libclang_rt.xray-fdr
// REQUIRES: linux || freebsd
// REQUIRES: amd64 || x86_64 || x86_64h || arm || aarch64 || arm64
2 changes: 2 additions & 0 deletions clang/test/Driver/XRay/xray-nolinkdeps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@
// RUN: 2>&1 | FileCheck --check-prefix DISABLE %s
// RUN: %clang -### --target=x86_64-unknown-linux-gnu -fxray-instrument %s \
// RUN: 2>&1 | FileCheck --check-prefix ENABLE %s
// RUN: %clang -### --target=x86_64-unknown-linux-gnu -shared -fxray-instrument %s \
// RUN: 2>&1 | FileCheck --check-prefix DISABLE %s
// ENABLE: "--whole-archive" "{{.*}}clang_rt.xray{{.*}}"--no-whole-archive"
// DISABLE-NOT: clang_rt.xray
16 changes: 0 additions & 16 deletions clang/test/Driver/XRay/xray-shared-noxray.cpp

This file was deleted.

0 comments on commit 841ff7c

Please sign in to comment.