[PATCH] D107786: [AIX]: Fix option processing for -b

Ettore Tiotto via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 9 16:18:56 PDT 2021


etiotto updated this revision to Diff 365311.
etiotto added a comment.

Adapting test for -b option processing on AIX


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D107786/new/

https://reviews.llvm.org/D107786

Files:
  clang/lib/Driver/ToolChains/CommonArgs.cpp
  clang/test/Driver/Xlinker-args.c


Index: clang/test/Driver/Xlinker-args.c
===================================================================
--- clang/test/Driver/Xlinker-args.c
+++ clang/test/Driver/Xlinker-args.c
@@ -13,7 +13,7 @@
 // RUN: FileCheck -check-prefix=LINUX < %t %s
 
 // RUN: %clang -target powerpc-unknown-aix -### \
-// RUN:   -b one %s 2> %t
+// RUN:   -b one -b two %s 2> %t
 // RUN: FileCheck -check-prefix=AIX < %t %s
 
 // RUN: %clang -target powerpc-unknown-linux -### \
@@ -23,7 +23,7 @@
 // DARWIN-NOT: --no-demangle
 // DARWIN: "one" "two" "three" "four" "-z" "five" "-r"
 // LINUX: "--no-demangle" "-e" "_start" "one" "two" "three" "four" "-z" "five" "-r" {{.*}} "-T" "a.lds"
-// AIX: "-b" "one" 
+// AIX: "-b" "one" "-b" "two"
 // NOT-AIX: error: unsupported option '-b' for target 'powerpc-unknown-linux'
 
 // Check that we forward '-Xlinker' and '-Wl,' on Windows.
Index: clang/lib/Driver/ToolChains/CommonArgs.cpp
===================================================================
--- clang/lib/Driver/ToolChains/CommonArgs.cpp
+++ clang/lib/Driver/ToolChains/CommonArgs.cpp
@@ -268,7 +268,7 @@
       A.render(Args, CmdArgs);
     }
     // Handle reserved library options.
-    if (A.getOption().matches(options::OPT_Z_reserved_lib_stdcxx))
+    else if (A.getOption().matches(options::OPT_Z_reserved_lib_stdcxx))
       TC.AddCXXStdlibLibArgs(Args, CmdArgs);
     else if (A.getOption().matches(options::OPT_Z_reserved_lib_cckext))
       TC.AddCCKextLibArgs(Args, CmdArgs);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D107786.365311.patch
Type: text/x-patch
Size: 1478 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210809/f0cacea2/attachment.bin>


More information about the cfe-commits mailing list