Skip to content

Commit a19f729

Browse files
committed
add -S test and comment
Signed-off-by: Nick Sarnie <[email protected]>
1 parent 4af3b7e commit a19f729

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

clang/include/clang/Driver/CommonArgs.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,9 @@ void setComplexRange(const Driver &D, StringRef NewOpt,
312312
LangOptions::ComplexRangeKind NewRange, StringRef &LastOpt,
313313
LangOptions::ComplexRangeKind &Range);
314314

315+
// This function expects that the inputs to llvm-link will be specified by the
316+
// caller, but the output is handled by this function, with the optional ability
317+
// to set the output filename.
315318
void constructLlvmLinkCommand(Compilation &C, const Tool &T,
316319
const JobAction &JA,
317320
const InputInfoList &JobInputs,
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// Check BC input with -S
2+
// RUN: mkdir -p %t
3+
// RUN: touch %t/a.bc
4+
// RUN: touch %t/b.bc
5+
// RUN: %clang -### --target=spirv64 -emit-llvm -S %t/a.bc %t/b.bc 2>&1 | FileCheck --check-prefix=CHECK-TOOL-BC %s
6+
7+
// CHECK-TOOL-BC: "-cc1" {{.*}} "-o" "{{.*}}.ll" "-x" "ir" "{{.*}}.bc"
8+
// CHECK-TOOL-BC: "-cc1" {{.*}} "-o" "{{.*}}.ll" "-x" "ir" "{{.*}}.bc"
9+
// CHECK-TOOL-BC-NOT: llvm-link
10+
11+
// RUN: %clang -ccc-print-bindings --target=spirv64 -emit-llvm -S %t/a.bc %t/b.bc 2>&1 | FileCheck -check-prefix=CHECK-BINDINGS-BC %s
12+
13+
// CHECK-BINDINGS-BC: "spirv64" - "clang", inputs: ["{{.*}}.bc"], output: "[[TMP1_BINDINGS_BC:.+]]"
14+
// CHECK-BINDINGS-BC: "spirv64" - "clang", inputs: ["{{.*}}.bc"], output: "[[TMP2_BINDINGS_BC:.+]]"
15+
// CHECK-BINDINGS-BC-NOT: SPIR-V::Linker
16+
17+
// Check source input with -S
18+
// RUN: touch %t/foo.c
19+
// RUN: touch %t/bar.c
20+
21+
// RUN: %clang -### --target=spirv64 -emit-llvm -S %t/foo.c %t/bar.c 2>&1 | FileCheck --check-prefix=CHECK-TOOL-SRC %s
22+
23+
// CHECK-TOOL-SRC: "-cc1" {{.*}} "-o" "{{.*}}.ll" "-x" "c" "{{.*}}foo.c"
24+
// CHECK-TOOL-SRC: "-cc1" {{.*}} "-o" "{{.*}}.ll" "-x" "c" "{{.*}}bar.c"
25+
// CHECK-TOOL-SRC-NOT: llvm-link
26+
27+
// RUN: %clang -ccc-print-bindings --target=spirv64 -emit-llvm -S %t/foo.c %t/bar.c 2>&1 | FileCheck -check-prefix=CHECK-BINDINGS-SRC %s
28+
29+
// CHECK-BINDINGS-SRC: "spirv64" - "clang", inputs: ["{{.*}}foo.c"], output: "{{.*}}.ll"
30+
// CHECK-BINDINGS-SRC: "spirv64" - "clang", inputs: ["{{.*}}bar.c"], output: "{{.*}}.ll"
31+
// CHECK-BINDINGS-SRC-NOT: SPIR-V::Linker

0 commit comments

Comments
 (0)