From 74af44c9bdb30ae7cb2ccc3ebd5377d5e053ad83 Mon Sep 17 00:00:00 2001 From: Sagar Thakur Date: Wed, 15 Feb 2017 10:41:38 +0000 Subject: [PATCH] [XRAY][MIPS] Add -fxray-instrument for mips/mipsel/mips64/mips64el Summary: Adds xray instrument option for mips/mipsel/mips64/mips64el. Reviewed by sdardis, dberris Differential: D27698 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@295163 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Driver/Tools.cpp | 4 ++++ test/CodeGen/xray-attributes-supported-mips.cpp | 16 ++++++++++++++++ test/Driver/XRay/xray-instrument-cpu.c | 2 +- 3 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 test/CodeGen/xray-attributes-supported-mips.cpp diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index 87153c33fe..bc0796ff2a 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -5065,6 +5065,10 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, case llvm::Triple::arm: case llvm::Triple::aarch64: case llvm::Triple::ppc64le: + case llvm::Triple::mips: + case llvm::Triple::mipsel: + case llvm::Triple::mips64: + case llvm::Triple::mips64el: // Supported. break; default: diff --git a/test/CodeGen/xray-attributes-supported-mips.cpp b/test/CodeGen/xray-attributes-supported-mips.cpp new file mode 100644 index 0000000000..a7d04da8fe --- /dev/null +++ b/test/CodeGen/xray-attributes-supported-mips.cpp @@ -0,0 +1,16 @@ +// RUN: %clang_cc1 %s -fxray-instrument -std=c++11 -x c++ -emit-llvm -o - -triple mips-unknown-linux-gnu | FileCheck %s +// RUN: %clang_cc1 %s -fxray-instrument -std=c++11 -x c++ -emit-llvm -o - -triple mipsel-unknown-linux-gnu | FileCheck %s +// RUN: %clang_cc1 %s -fxray-instrument -std=c++11 -x c++ -emit-llvm -o - -triple mips64-unknown-linux-gnu | FileCheck %s +// RUN: %clang_cc1 %s -fxray-instrument -std=c++11 -x c++ -emit-llvm -o - -triple mips64el-unknown-linux-gnu | FileCheck %s + +// Make sure that the LLVM attribute for XRay-annotated functions do show up. +[[clang::xray_always_instrument]] void foo() { +// CHECK: define void @_Z3foov() #0 +}; + +[[clang::xray_never_instrument]] void bar() { +// CHECK: define void @_Z3barv() #1 +}; + +// CHECK: #0 = {{.*}}"function-instrument"="xray-always" +// CHECK: #1 = {{.*}}"function-instrument"="xray-never" diff --git a/test/Driver/XRay/xray-instrument-cpu.c b/test/Driver/XRay/xray-instrument-cpu.c index 8215cc16e1..ee0e0984b3 100644 --- a/test/Driver/XRay/xray-instrument-cpu.c +++ b/test/Driver/XRay/xray-instrument-cpu.c @@ -1,4 +1,4 @@ // RUN: not %clang -o /dev/null -v -fxray-instrument -c %s -// XFAIL: amd64-, x86_64-, x86_64h-, arm, aarch64, arm64, powerpc64le- +// XFAIL: amd64-, x86_64-, x86_64h-, arm, aarch64, arm64, powerpc64le-, mips, mipsel, mips64, mips64el // REQUIRES: linux typedef int a; -- 2.40.0