blob: 8bb05cea709e9665ec4d62a71fc27da821320925 [file] [log] [blame]
Ian Levesque7c7c8e02020-06-16 20:36:11 -04001// This test ensures that when we invoke the clang compiler, that the -cc1
2// options respect the -fno-xray-function-index flag we provide in the
3// invocation. The default should be to *include* the function index.
4//
5// RUN: %clang -fxray-instrument -fxray-function-index -target x86_64-linux- -### \
6// RUN: -x c++ -std=c++11 -emit-llvm -c -o - %s 2>&1 \
7// RUN: | FileCheck %s
8// CHECK-NOT: -fno-xray-function-index
9//
10// RUN: %clang -fxray-instrument -target x86_64-linux- -### \
11// RUN: -x c++ -std=c++11 -emit-llvm -c -o - %s 2>&1 \
12// RUN: | FileCheck %s -check-prefix CHECK-DEFAULT
13// CHECK-DEFAULT-NOT: -fno-xray-function-index
14//
15// RUN: %clang -fxray-instrument -fno-xray-function-index -target x86_64-linux- -### \
16// RUN: -x c++ -std=c++11 -emit-llvm -c -o - %s 2>&1 \
17// RUN: | FileCheck %s -check-prefix CHECK-DISABLED
18// CHECK-DISABLED: -fno-xray-function-index
19//
20// REQUIRES: x86_64 || x86_64h