[clang] adf8d6e - [Driver][test] Specify --target= for a -gsplit-dwarf test

Fangrui Song via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 9 07:42:44 PDT 2023


Author: Fangrui Song
Date: 2023-08-09T07:42:38-07:00
New Revision: adf8d6e7a4674b9149d69da7e1d53b3c3ba64ec8

URL: https://github.com/llvm/llvm-project/commit/adf8d6e7a4674b9149d69da7e1d53b3c3ba64ec8
DIFF: https://github.com/llvm/llvm-project/commit/adf8d6e7a4674b9149d69da7e1d53b3c3ba64ec8.diff

LOG: [Driver][test] Specify --target= for a -gsplit-dwarf test

Otherwise, if -DLLVM_DEFAULT_TARGET_TRIPLE=riscv64-unknown-linux-gnu,
the %clang command will exit with code 1 (see https://reviews.llvm.org/D130190).

Exposed by D156363.

Added: 
    

Modified: 
    clang/test/Driver/debug-options.c

Removed: 
    


################################################################################
diff  --git a/clang/test/Driver/debug-options.c b/clang/test/Driver/debug-options.c
index 49e7f5c1a25646..4f7906f80cd79f 100644
--- a/clang/test/Driver/debug-options.c
+++ b/clang/test/Driver/debug-options.c
@@ -241,8 +241,9 @@
 // RUN: %clang -### -c -ggdb %s 2>&1 | FileCheck -check-prefix=NOPUB %s
 // RUN: %clang -### -c -gpubnames -gno-gnu-pubnames %s 2>&1 | FileCheck -check-prefix=NOPUB %s
 // RUN: %clang -### -c -gpubnames -gno-pubnames %s 2>&1 | FileCheck -check-prefix=NOPUB %s
-//
-// RUN: %clang -### -c -gsplit-dwarf -g -gno-pubnames %s 2>&1 | FileCheck -check-prefix=NOPUB %s
+
+/// Specify --target= so that %clang doesn't exit with code 1 even if LLVM_DEFAULT_TARGET_TRIPLE specifies a RISC-V target triple.
+// RUN: %clang -### --target=x86_64 -c -gsplit-dwarf -g -gno-pubnames %s 2>&1 | FileCheck -check-prefix=NOPUB %s
 //
 // RUN: %clang -### -c -fdebug-ranges-base-address %s 2>&1 | FileCheck -check-prefix=RNGBSE %s
 // RUN: %clang -### -c %s 2>&1 | FileCheck -check-prefix=NORNGBSE %s


        


More information about the cfe-commits mailing list