| 1 |
// RUN: %clangxx --target=x86_64-linux-gnu -fmemory-profile %s -### 2>&1 | FileCheck %s |
| 2 |
// RUN: %clangxx --target=x86_64-linux-gnu -fmemory-profile=foo %s -### 2>&1 | FileCheck %s --check-prefix=DIR |
| 3 |
// RUN: %clangxx --target=x86_64-linux-gnu -fmemory-profile -fno-memory-profile %s -### 2>&1 | FileCheck %s --check-prefix=OFF |
| 4 |
// RUN: %clangxx --target=x86_64-linux-gnu -fmemory-profile=foo -fno-memory-profile %s -### 2>&1 | FileCheck %s --check-prefix=OFF |
| 5 |
// CHECK: "-cc1" {{.*}} "-fmemory-profile" |
| 6 |
// CHECK: ld{{.*}}libclang_rt.memprof{{.*}}libclang_rt.memprof_cxx |
| 7 |
// DIR: "-cc1" {{.*}} "-fmemory-profile=foo" |
| 8 |
// DIR: ld{{.*}}libclang_rt.memprof{{.*}}libclang_rt.memprof_cxx |
| 9 |
// OFF-NOT: "-fmemory-profile" |
| 10 |
// OFF-NOT: libclang_rt.memprof |
| 11 |
|
| 12 |
// RUN: %clangxx --target=x86_64-linux-gnu -fmemory-profile-use=foo %s -### 2>&1 | FileCheck %s --check-prefix=USE |
| 13 |
// USE: "-cc1" {{.*}} "-fmemory-profile-use=foo" |
| 14 |
|
| 15 |
// RUN: not %clangxx --target=x86_64-linux-gnu -fmemory-profile -fmemory-profile-use=foo %s -### 2>&1 | FileCheck %s --check-prefix=CONFLICTWITHMEMPROFINSTR |
| 16 |
// CONFLICTWITHMEMPROFINSTR: error: invalid argument '-fmemory-profile-use=foo' not allowed with '-fmemory-profile' |
| 17 |
|
| 18 |
// RUN: not %clangxx --target=x86_64-linux-gnu -fprofile-generate -fmemory-profile-use=foo %s -### 2>&1 | FileCheck %s --check-prefix=CONFLICTWITHPGOINSTR |
| 19 |
// CONFLICTWITHPGOINSTR: error: invalid argument '-fmemory-profile-use=foo' not allowed with '-fprofile-generate' |
| 20 |
|
| 21 |
// Test that we export the __memprof_default_options_str on Darwin because it has WeakAnyLinkage |
| 22 |
// RUN: %clangxx --target=arm64-apple-ios -fmemory-profile %s -### 2>&1 | FileCheck %s --check-prefix=EXPORT-BASE --implicit-check-not=exported_symbol |
| 23 |
// RUN: %clangxx --target=arm64-apple-ios -fmemory-profile -exported_symbols_list /dev/null %s -### 2>&1 | FileCheck %s --check-prefixes=EXPORT-BASE,EXPORT |
| 24 |
// FIXME: Darwin needs to link in the runtime, then we can use the regular CHECK prefix |
| 25 |
// EXPORT-BASE: "-cc1" {{.*}} "-fmemory-profile" |
| 26 |
// EXPORT: "-exported_symbol" "___memprof_default_options_str" |