1 // Ensure that we have a quiet startup when we don't have the XRay
2 // instrumentation sleds.
3 //
4 // RUN: %clangxx -std=c++11 %s -o %t %xraylib
5 // RUN: XRAY_OPTIONS="patch_premain=true verbosity=1" %run %t 2>&1 | \
6 // RUN:    FileCheck %s --check-prefix NOISY
7 // RUN: XRAY_OPTIONS="patch_premain=true verbosity=0" %run %t 2>&1 | \
8 // RUN:    FileCheck %s --check-prefix QUIET
9 // RUN: XRAY_OPTIONS="" %run %t 2>&1 | FileCheck %s --check-prefix DEFAULT
10 //
11 // FIXME: Understand how to make this work on other platforms
12 // REQUIRES: built-in-llvm-tree
13 // REQUIRES: x86_64-target-arch
14 #include <iostream>
15 
16 using namespace std;
17 
main(int,char **)18 int main(int, char**) {
19   // NOISY: {{.*}}XRay instrumentation map missing. Not initializing XRay.
20   // QUIET-NOT: {{.*}}XRay instrumentation map missing. Not initializing XRay.
21   // DEFAULT-NOT: {{.*}}XRay instrumentation map missing. Not initializing XRay.
22   cout << "Hello, XRay!" << endl;
23   // NOISY: Hello, XRay!
24   // QUIET: Hello, XRay!
25   // DEFAULT: Hello, XRay!
26 }
27