Clang Project

clang_source_code/test/Driver/cuda-no-pgo-or-coverage.cu
1// Check that profiling/coverage arguments doen't get passed down to device-side
2// compilation.
3//
4// REQUIRES: clang-driver
5//
6// XRUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=sm_20 \
7// XRUN:   -fprofile-generate %s 2>&1 | \
8// XRUN: FileCheck --check-prefixes=CHECK,PROF %s
9//
10// RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=sm_20 \
11// RUN:   -fprofile-instr-generate %s 2>&1 | \
12// RUN: FileCheck -allow-deprecated-dag-overlap --check-prefixes=CHECK,PROF %s
13//
14// RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=sm_20 \
15// RUN:   -coverage %s 2>&1 | \
16// RUN: FileCheck -allow-deprecated-dag-overlap --check-prefixes=CHECK,GCOV %s
17//
18// RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=sm_20 \
19// RUN:   -ftest-coverage %s 2>&1 | \
20// RUN: FileCheck -allow-deprecated-dag-overlap --check-prefixes=CHECK,GCOV %s
21//
22// RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=sm_20   \
23// RUN:   -fprofile-instr-generate -fcoverage-mapping %s 2>&1 | \
24// RUN: FileCheck -allow-deprecated-dag-overlap --check-prefixes=CHECK,PROF,GCOV %s
25//
26//
27// CHECK-NOT: error: unsupported option '-fprofile
28// CHECK-NOT: error: invalid argument
29// CHECK-DAG: "-fcuda-is-device"
30// CHECK-NOT: "-f{{[^"]*coverage.*}}"
31// CHECK-NOT: "-fprofile{{[^"]*}}"
32// CHECK: "-triple" "x86_64-unknown-linux-gnu"
33// PROF-DAG: "-fprofile{{.*}}"
34// GCOV-DAG: "-f{{(coverage|emit-coverage).*}}"
35