Clang Project

clang_source_code/test/Driver/XRay/xray-mode-flags.cpp
1// RUN: %clang -v -o /dev/null -fxray-instrument -fxray-modes=xray-fdr %s -### \
2// RUN:     2>&1 | FileCheck --check-prefix FDR %s
3// RUN: %clang -v -o /dev/null -fxray-instrument -fxray-modes=xray-basic %s \
4// RUN:     -### 2>&1 | FileCheck --check-prefix BASIC %s
5// RUN: %clang -v -o /dev/null -fxray-instrument -fxray-modes=all -### %s \
6// RUN:     2>&1 | FileCheck --check-prefixes FDR,BASIC %s
7// RUN: %clang -v -o /dev/null -fxray-instrument \
8// RUN:     -fxray-modes=xray-fdr,xray-basic -### %s 2>&1 | \
9// RUN:     FileCheck --check-prefixes FDR,BASIC %s
10// RUN: %clang -v -o /dev/null -fxray-instrument \
11// RUN:     -fxray-modes=xray-fdr -fxray-modes=xray-basic -### %s 2>&1 | \
12// RUN:     FileCheck --check-prefixes FDR,BASIC %s
13// RUN: %clang -v -o /dev/null -fxray-instrument -### %s \
14// RUN:     2>&1 | FileCheck --check-prefixes FDR,BASIC %s
15// RUN: %clang -v -o /dev/null -fxray-instrument -fxray-modes=none -### %s \
16// RUN:     2>&1 | FileCheck --check-prefixes NONE %s
17//
18// We also should support overriding the modes in an additive manner.
19//
20// RUN: %clang -v -o /dev/null -fxray-instrument -fxray-modes=none,xray-fdr \
21// RUN:     -### %s \
22// RUN:     2>&1 | FileCheck --check-prefixes FDR %s
23// RUN: %clang -v -o /dev/null -fxray-instrument -fxray-modes=xray-fdr,none \
24// RUN:     -### %s \
25// RUN:     2>&1 | FileCheck --check-prefixes NONE %s
26// RUN: %clang -v -o /dev/null -fxray-instrument -fxray-modes=none,all \
27// RUN:     -### %s \
28// RUN:     2>&1 | FileCheck --check-prefixes FDR,BASIC %s
29//
30// We also should support having the individual modes be concatenated.
31//
32// RUN: %clang -v -o /dev/null -fxray-instrument -fxray-modes=none \
33// RUN:     -fxray-modes=xray-fdr \
34// RUN:     -### %s \
35// RUN:     2>&1 | FileCheck --check-prefixes FDR %s
36//
37// Order also matters.
38//
39// RUN: %clang -v -o /dev/null -fxray-instrument -fxray-modes=xray-fdr \
40// RUN:     -fxray-modes=none \
41// RUN:     -### %s \
42// RUN:     2>&1 | FileCheck --check-prefixes NONE %s
43
44// BASIC: libclang_rt.xray-basic
45// FDR: libclang_rt.xray-fdr
46// NONE-NOT: libclang_rt.xray-basic
47// NONE-NOT: libclang_rt.xray-fdr
48// REQUIRES-ANY: linux, freebsd
49// REQUIRES-ANY: amd64, x86_64, x86_64h, arm, aarch64, arm64
50