|
| 1 | +// REQUIRES: clang-driver |
| 2 | +// REQUIRES: x86-registered-target |
| 3 | +// REQUIRES: nvptx-registered-target |
| 4 | +// REQUIRES: zlib |
| 5 | + |
| 6 | +// RUN: %clang -### -target x86_64-linux-gnu -c %s -g -gz 2>&1 \ |
| 7 | +// RUN: | FileCheck %s --check-prefixes WARN,COMMON |
| 8 | +// RUN: %clang -### -target x86_64-linux-gnu -c %s -gdwarf -fdebug-info-for-profiling 2>&1 \ |
| 9 | +// RUN: | FileCheck %s --check-prefixes WARN,COMMON |
| 10 | +// RUN: %clang -### -target x86_64-linux-gnu -c %s -gdwarf-2 -gsplit-dwarf 2>&1 \ |
| 11 | +// RUN: | FileCheck %s --check-prefixes WARN,COMMON |
| 12 | +// RUN: %clang -### -target x86_64-linux-gnu -c %s -gdwarf-3 -glldb 2>&1 \ |
| 13 | +// RUN: | FileCheck %s --check-prefixes WARN,COMMON |
| 14 | +// RUN: %clang -### -target x86_64-linux-gnu -c %s -gdwarf-4 -gcodeview 2>&1 \ |
| 15 | +// RUN: | FileCheck %s --check-prefixes WARN,COMMON |
| 16 | +// RUN: %clang -### -target x86_64-linux-gnu -c %s -gdwarf-5 -gmodules 2>&1 \ |
| 17 | +// RUN: | FileCheck %s --check-prefixes WARN,COMMON |
| 18 | +// RUN: %clang -### -target x86_64-linux-gnu -c %s -ggdb1 -fdebug-macro 2>&1 \ |
| 19 | +// RUN: | FileCheck %s --check-prefixes WARN,COMMON |
| 20 | +// RUN: %clang -### -target x86_64-linux-gnu -c %s -ggdb2 -ggnu-pubnames 2>&1 \ |
| 21 | +// RUN: | FileCheck %s --check-prefixes WARN,COMMON |
| 22 | +// RUN: %clang -### -target x86_64-linux-gnu -c %s -ggdb3 -gdwarf-aranges 2>&1 \ |
| 23 | +// RUN: | FileCheck %s --check-prefixes WARN,COMMON |
| 24 | +// RUN: %clang -### -target x86_64-linux-gnu -c %s -g -gcolumn-info -fdebug-types-section 2>&1 \ |
| 25 | +// RUN: | FileCheck %s --check-prefixes WARN,COMMON |
| 26 | + |
| 27 | +// Same tests for OpenMP |
| 28 | +// RUN: %clang -### -target x86_64-linux-gnu -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -c %s \ |
| 29 | +// RUN: -g -gz 2>&1 | FileCheck %s --check-prefixes WARN,COMMON |
| 30 | +// RUN: %clang -### -target x86_64-linux-gnu -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -c %s \ |
| 31 | +// RUN: -gdwarf -fdebug-info-for-profiling 2>&1 | FileCheck %s --check-prefixes WARN,COMMON |
| 32 | +// RUN: %clang -### -target x86_64-linux-gnu -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -c %s \ |
| 33 | +// RUN: -gdwarf-2 -gsplit-dwarf 2>&1 | FileCheck %s --check-prefixes WARN,COMMON |
| 34 | +// RUN: %clang -### -target x86_64-linux-gnu -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -c %s \ |
| 35 | +// RUN: -gdwarf-3 -glldb 2>&1 | FileCheck %s --check-prefixes WARN,COMMON |
| 36 | +// RUN: %clang -### -target x86_64-linux-gnu -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -c %s \ |
| 37 | +// RUN: -gdwarf-4 -gcodeview 2>&1 | FileCheck %s --check-prefixes WARN,COMMON |
| 38 | +// RUN: %clang -### -target x86_64-linux-gnu -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -c %s \ |
| 39 | +// RUN: -gdwarf-5 -gmodules 2>&1 | FileCheck %s --check-prefixes WARN,COMMON |
| 40 | +// RUN: %clang -### -target x86_64-linux-gnu -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -c %s \ |
| 41 | +// RUN: -ggdb1 -fdebug-macro 2>&1 | FileCheck %s --check-prefixes WARN,COMMON |
| 42 | +// RUN: %clang -### -target x86_64-linux-gnu -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -c %s \ |
| 43 | +// RUN: -ggdb2 -ggnu-pubnames 2>&1 | FileCheck %s --check-prefixes WARN,COMMON |
| 44 | +// RUN: %clang -### -target x86_64-linux-gnu -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -c %s \ |
| 45 | +// RUN: -ggdb3 -gdwarf-aranges 2>&1 | FileCheck %s --check-prefixes WARN,COMMON |
| 46 | +// RUN: %clang -### -target x86_64-linux-gnu -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -c %s \ |
| 47 | +// RUN: -g -gcolumn-info -fdebug-types-section 2>&1 | FileCheck %s --check-prefixes WARN,COMMON |
| 48 | + |
| 49 | +// RUN: %clang -### -target x86_64-linux-gnu -c %s -gdwarf-5 -gembed-source 2>&1 \ |
| 50 | +// RUN: | FileCheck %s --check-prefixes WARN-GES,COMMON |
| 51 | +// RUN: %clang -### -target x86_64-linux-gnu -c %s -ggdb -gembed-source -gdwarf-5 2>&1 \ |
| 52 | +// RUN: | FileCheck %s --check-prefixes WARN-GES,COMMON |
| 53 | +// RUN: %clang -### -target x86_64-linux-gnu -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -c %s \ |
| 54 | +// RUN: -gdwarf-5 -gembed-source 2>&1 | FileCheck %s --check-prefixes WARN-GES,COMMON |
| 55 | +// RUN: %clang -### -target x86_64-linux-gnu -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -c %s \ |
| 56 | +// RUN: -ggdb -gembed-source -gdwarf-5 2>&1 | FileCheck %s --check-prefixes WARN-GES,COMMON |
| 57 | + |
| 58 | +// COMMON: warning: debug information option '{{-gz|-fdebug-info-for-profiling|-gsplit-dwarf|-glldb|-gcodeview|-gmodules|-gembed-source|-fdebug-macro|-ggnu-pubnames|-gdwarf-aranges|-fdebug-types-section}}' is not supported |
| 59 | +// WARN-SAME: for target 'nvptx64-nvidia-cuda' [-Wunsupported-target-opt] |
| 60 | +// WARN-GES-SAME: It needs DWARF-5 but target 'nvptx64-nvidia-cuda' only provides DWARF-2. [-Wunsupported-target-opt] |
| 61 | +// COMMON-NOT: debug information option '{{.*}}' is not supported for target 'x86 |
| 62 | +// COMMON: "-triple" "nvptx64-nvidia-cuda" |
| 63 | +// COMMON-NOT: {{-compress-debug|-fdebug-info-for-profiling|lldb|codeview|module-format|embed-source|debug-info-macro|gnu-pubnames|generate-arange-section|generate-type-units}} |
| 64 | +// COMMON: "-triple" "x86_64 |
| 65 | +// COMMON-SAME: {{-compress-debug|-fdebug-info-for-profiling|split-dwarf|lldb|codeview|module-format|embed-source|debug-info-macro|gnu-pubnames|generate-arange-section|generate-type-units}} |
0 commit comments