xref: /minix3/external/bsd/llvm/dist/clang/test/Driver/cl-link-at-file.c (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc // PR17239 - The /link option, when inside a response file, should only extend
2*0a6a1f1dSLionel Sambuc // until the end of the response file (and not the entire command line)
3*0a6a1f1dSLionel Sambuc 
4*0a6a1f1dSLionel Sambuc // Don't attempt slash switches on msys bash.
5*0a6a1f1dSLionel Sambuc // REQUIRES: shell-preserves-root
6*0a6a1f1dSLionel Sambuc 
7*0a6a1f1dSLionel Sambuc // Note: %s must be preceded by -- or bound to another option, otherwise it may
8*0a6a1f1dSLionel Sambuc // be interpreted as a command-line option, e.g. on Mac where %s is commonly
9*0a6a1f1dSLionel Sambuc // under /Users.
10*0a6a1f1dSLionel Sambuc 
11*0a6a1f1dSLionel Sambuc // RUN: echo /link bar.lib baz.lib > %t.args
12*0a6a1f1dSLionel Sambuc // RUN: touch %t.obj
13*0a6a1f1dSLionel Sambuc // RUN: %clang_cl -### @%t.args -- %t.obj 2>&1 | FileCheck %s -check-prefix=ARGS
14*0a6a1f1dSLionel Sambuc // If the "/link" option captures all remaining args beyond its response file,
15*0a6a1f1dSLionel Sambuc // it will also capture "--" and our input argument. In this case, Clang will
16*0a6a1f1dSLionel Sambuc // be clueless and will emit "argument unused" warnings. If PR17239 is properly
17*0a6a1f1dSLionel Sambuc // fixed, this should not happen because the "/link" option is restricted to
18*0a6a1f1dSLionel Sambuc // consume only remaining args in its response file.
19*0a6a1f1dSLionel Sambuc // ARGS-NOT: warning
20*0a6a1f1dSLionel Sambuc // ARGS-NOT: argument unused during compilation
21*0a6a1f1dSLionel Sambuc // Identify the linker command
22*0a6a1f1dSLionel Sambuc // ARGS: link.exe
23