Skip to content

Commit

Permalink
[test][clang] run test for lld emitting dwarf-aranages only if lld is…
Browse files Browse the repository at this point in the history
  • Loading branch information
azat authored and hokein committed Sep 14, 2022
1 parent cae9c64 commit 44075cc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
12 changes: 12 additions & 0 deletions clang/test/Driver/debug-options-lld.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// REQUIRES: lld
// Check that lld will emit dwarf aranges.

// RUN: %clang -### -target x86_64-unknown-linux -c -gdwarf-aranges %s 2>&1 | FileCheck -check-prefix=GARANGE %s
// RUN: %clang -### -target x86_64-unknown-linux -flto -gdwarf-aranges %s 2>&1 | FileCheck -check-prefix=LDGARANGE %s
// RUN: %clang -### -target x86_64-unknown-linux -flto=thin -gdwarf-aranges %s 2>&1 | FileCheck -check-prefix=LDGARANGE %s
// RUN: %clang -### -target x86_64-unknown-linux -fuse-ld=lld -flto -gdwarf-aranges %s 2>&1 | FileCheck -check-prefix=LLDGARANGE %s
// RUN: %clang -### -target x86_64-unknown-linux -fuse-ld=lld -flto=thin -gdwarf-aranges %s 2>&1 | FileCheck -check-prefix=LLDGARANGE %s
//
// GARANGE-DAG: -generate-arange-section
// LDGARANGE-NOT: {{".*lld.*"}} {{.*}} "-generate-arange-section"
// LLDGARANGE: {{".*lld.*"}} {{.*}} "-generate-arange-section"
8 changes: 1 addition & 7 deletions clang/test/Driver/debug-options.c
Original file line number Diff line number Diff line change
Expand Up @@ -246,11 +246,7 @@
// RUN: %clang -### -c -glldb %s 2>&1 | FileCheck -check-prefix=NOPUB %s
// RUN: %clang -### -c -glldb -gno-pubnames %s 2>&1 | FileCheck -check-prefix=NOPUB %s
//
// RUN: %clang -### -target x86_64-unknown-linux -c -gdwarf-aranges %s 2>&1 | FileCheck -check-prefix=GARANGE %s
// RUN: %clang -### -target x86_64-unknown-linux -flto -gdwarf-aranges %s 2>&1 | FileCheck -check-prefix=LDGARANGE %s
// RUN: %clang -### -target x86_64-unknown-linux -flto=thin -gdwarf-aranges %s 2>&1 | FileCheck -check-prefix=LDGARANGE %s
// RUN: %clang -### -target x86_64-unknown-linux -fuse-ld=lld -flto -gdwarf-aranges %s 2>&1 | FileCheck -check-prefix=LLDGARANGE %s
// RUN: %clang -### -target x86_64-unknown-linux -fuse-ld=lld -flto=thin -gdwarf-aranges %s 2>&1 | FileCheck -check-prefix=LLDGARANGE %s
// RUN: %clang -### -c -gdwarf-aranges %s 2>&1 | FileCheck -check-prefix=GARANGE %s
//
// RUN: %clang -### -fdebug-types-section -target x86_64-unknown-linux %s 2>&1 \
// RUN: | FileCheck -check-prefix=FDTS %s
Expand Down Expand Up @@ -375,8 +371,6 @@
// NORNGBSE-NOT: -fdebug-ranges-base-address
//
// GARANGE-DAG: -generate-arange-section
// LDGARANGE-NOT: {{".*lld.*"}} {{.*}} "-generate-arange-section"
// LLDGARANGE: {{".*lld.*"}} {{.*}} "-generate-arange-section"
//
// FDTS: "-mllvm" "-generate-type-units"
// FDTSE: error: unsupported option '-fdebug-types-section' for target 'x86_64-apple-darwin'
Expand Down

0 comments on commit 44075cc

Please sign in to comment.