| 1 |
// |
| 2 |
// RUN: %clang -### --target=x86_64-linux-gnu -c --cuda-gpu-arch=sm_20 %s -g -O1 --no-cuda-noopt-device-debug --cuda-path=%S/Inputs/CUDA_80/usr/local/cuda 2>&1 | \ |
| 3 |
// RUN: FileCheck %s -check-prefix DEBUG_DIRECTIVES |
| 4 |
// RUN: %clang -### --target=x86_64-linux-gnu -c --cuda-gpu-arch=sm_20 %s -g -O3 --cuda-path=%S/Inputs/CUDA_80/usr/local/cuda 2>&1 | \ |
| 5 |
// RUN: FileCheck %s -check-prefix DEBUG_DIRECTIVES |
| 6 |
// RUN: %clang -### --target=x86_64-linux-gnu -c --cuda-gpu-arch=sm_20 %s -g -O3 --no-cuda-noopt-device-debug --cuda-path=%S/Inputs/CUDA_80/usr/local/cuda 2>&1 | \ |
| 7 |
// RUN: FileCheck %s -check-prefix DEBUG_DIRECTIVES |
| 8 |
// RUN: %clang -### --target=x86_64-linux-gnu -c --cuda-gpu-arch=sm_20 %s -g0 --cuda-path=%S/Inputs/CUDA_80/usr/local/cuda 2>&1 | \ |
| 9 |
// RUN: FileCheck %s -check-prefix NO_DEBUG |
| 10 |
// RUN: %clang -### --target=x86_64-linux-gnu -c --cuda-gpu-arch=sm_20 %s -ggdb0 -O3 --cuda-noopt-device-debug --cuda-path=%S/Inputs/CUDA_80/usr/local/cuda 2>&1 | \ |
| 11 |
// RUN: FileCheck %s -check-prefix NO_DEBUG |
| 12 |
// RUN: %clang -### --target=x86_64-linux-gnu -c --cuda-gpu-arch=sm_20 %s -gline-directives-only -O2 --cuda-noopt-device-debug --cuda-path=%S/Inputs/CUDA_80/usr/local/cuda 2>&1 | \ |
| 13 |
// RUN: FileCheck %s -check-prefix DEBUG_DIRECTIVES |
| 14 |
|
| 15 |
// NO_DEBUG-NOT: warning: debug |
| 16 |
// DEBUG_DIRECTIVES-NOT: warning: debug |
| 17 |
// NO_DEBUG: "-fcuda-is-device" |
| 18 |
// NO_DEBUG-NOT: "-debug-info-kind= |
| 19 |
// NO_DEBUG: ptxas |
| 20 |
// NO_DEBUG-NOT: "-g" |
| 21 |
// DEBUG_DIRECTIVES: "-fcuda-is-device" |
| 22 |
// DEBUG_DIRECTIVES-SAME: "-debug-info-kind=line-directives-only" |
| 23 |
// DEBUG_DIRECTIVES: ptxas |
| 24 |
// DEBUG_DIRECTIVES-SAME: "-lineinfo" |
| 25 |
// NO_DEBUG: fatbinary |
| 26 |
// NO_DEBUG-NOT: "-g" |
| 27 |
|
| 28 |
// RUN: not %clang -### --target=x86_64-linux-gnu -c --cuda-gpu-arch=sm_20 %s -g 2>&1 | \ |
| 29 |
// RUN: FileCheck %s -check-prefix HAS_DEBUG |
| 30 |
// RUN: not %clang -### --target=x86_64-linux-gnu -c --cuda-gpu-arch=sm_20 %s -g -O0 --cuda-noopt-device-debug 2>&1 | \ |
| 31 |
// RUN: FileCheck %s -check-prefix HAS_DEBUG |
| 32 |
// RUN: not %clang -### --target=x86_64-linux-gnu -c --cuda-gpu-arch=sm_20 %s -g -O0 --no-cuda-noopt-device-debug 2>&1 | \ |
| 33 |
// RUN: FileCheck %s -check-prefix HAS_DEBUG |
| 34 |
// RUN: not %clang -### --target=x86_64-linux-gnu -c --cuda-gpu-arch=sm_20 %s -g -O3 --cuda-noopt-device-debug 2>&1 | \ |
| 35 |
// RUN: FileCheck %s -check-prefix HAS_DEBUG |
| 36 |
// RUN: not %clang -### --target=x86_64-linux-gnu -c --cuda-gpu-arch=sm_20 %s -g2 2>&1 | \ |
| 37 |
// RUN: FileCheck %s -check-prefix HAS_DEBUG |
| 38 |
// RUN: not %clang -### --target=x86_64-linux-gnu -c --cuda-gpu-arch=sm_20 %s -ggdb2 -O0 2>&1 | \ |
| 39 |
// RUN: FileCheck %s -check-prefix HAS_DEBUG |
| 40 |
// RUN: not %clang -### --target=x86_64-linux-gnu -c --cuda-gpu-arch=sm_20 %s -g3 -O2 --cuda-noopt-device-debug 2>&1 | \ |
| 41 |
// RUN: FileCheck %s -check-prefix HAS_DEBUG |
| 42 |
// RUN: not %clang -### --target=x86_64-linux-gnu -c --cuda-gpu-arch=sm_20 %s -ggdb3 -O3 --cuda-noopt-device-debug 2>&1 | \ |
| 43 |
// RUN: FileCheck %s -check-prefix HAS_DEBUG |
| 44 |
// RUN: not %clang -### --target=x86_64-linux-gnu -c --cuda-gpu-arch=sm_20 %s -ggdb1 2>&1 | \ |
| 45 |
// RUN: FileCheck %s -check-prefix HAS_DEBUG |
| 46 |
// RUN: not %clang -### --target=x86_64-linux-gnu -c --cuda-gpu-arch=sm_20 %s -gline-tables-only -O2 --cuda-noopt-device-debug 2>&1 | \ |
| 47 |
// RUN: FileCheck %s -check-prefix HAS_DEBUG |
| 48 |
|
| 49 |
// HAS_DEBUG-NOT: warning: debug |
| 50 |
// HAS_DEBUG: "-fcuda-is-device" |
| 51 |
// HAS_DEBUG-SAME: "-debug-info-kind={{constructor|line-tables-only}}" |
| 52 |
// HAS_DEBUG-SAME: "-dwarf-version=2" |
| 53 |
// HAS_DEBUG: ptxas |
| 54 |
// HAS_DEBUG-SAME: "-g" |
| 55 |
// HAS_DEBUG-SAME: "--dont-merge-basicblocks" |
| 56 |
// HAS_DEBUG-SAME: "--return-at-end" |
| 57 |
// HAS_DEBUG: fatbinary |
| 58 |
// HAS_DEBUG-SAME: "-g" |
| 59 |
|