xref: /aosp_15_r20/external/llvm/test/Other/ResponseFile.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; Test that we can recurse, at least a little bit.  The -time-passes flag here
2*9880d681SAndroid Build Coastguard Worker; is a hack to make sure that neither echo nor the shell expands the response
3*9880d681SAndroid Build Coastguard Worker; file for us.  Tokenization with quotes is tested in unittests.
4*9880d681SAndroid Build Coastguard Worker; On Windows, paths contain \ characters, which are escape characters in
5*9880d681SAndroid Build Coastguard Worker; GNU-style response files.  So replace \ with \\ to make the tests work there.
6*9880d681SAndroid Build Coastguard Worker; RUN: echo %s | sed -e 's:\\:\\\\:g' > %t.list1
7*9880d681SAndroid Build Coastguard Worker; RUN: echo "-time-passes @%t.list1" | sed -e 's:\\:\\\\:g' > %t.list2
8*9880d681SAndroid Build Coastguard Worker; RUN: llvm-as @%t.list2 -o %t.bc
9*9880d681SAndroid Build Coastguard Worker; RUN: llvm-nm %t.bc 2>&1 | FileCheck %s
10*9880d681SAndroid Build Coastguard Worker
11*9880d681SAndroid Build Coastguard Worker; When the response file begins with UTF8 BOM sequence, we shall remove them.
12*9880d681SAndroid Build Coastguard Worker; Neither command below should return a "Could not open input file" error.
13*9880d681SAndroid Build Coastguard Worker; RUN: llvm-as @%S/Inputs/utf8-response > /dev/null
14*9880d681SAndroid Build Coastguard Worker; RUN: llvm-as @%S/Inputs/utf8-bom-response > /dev/null
15*9880d681SAndroid Build Coastguard Worker
16*9880d681SAndroid Build Coastguard Worker; CHECK: T foobar
17*9880d681SAndroid Build Coastguard Worker
18*9880d681SAndroid Build Coastguard Workerdefine void @foobar() {
19*9880d681SAndroid Build Coastguard Worker  ret void
20*9880d681SAndroid Build Coastguard Worker}
21