Skip to content

Commit 635f845

Browse files
mdtoguchibader
authored andcommitted
[SYCL][NFC] Update tempfile test to only use driver output and FileCheck
Signed-off-by: Michael D Toguchi <[email protected]>
1 parent b683d3b commit 635f845

File tree

1 file changed

+11
-34
lines changed

1 file changed

+11
-34
lines changed
Lines changed: 11 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,12 @@
11
// UNSUPPORTED: system-windows
2-
//
3-
// Test to determine that temp file cleanup is working for fat static archives
4-
// creates a single file fat archive then uses that
5-
// RUN: rm -rf %t
6-
// RUN: mkdir %t
7-
// Build static library
8-
// RUN: %clang -DBUILD_B -fsycl -c -o %t_obj.o %s
9-
// RUN: ar cr %t_lib.a %t_obj.o
10-
// Build main object
11-
// RUN: %clang -DBUILD_A -fsycl -c -o %t_main.o %s
12-
// Build final binary, overriding output temp location
13-
// RUN: env TMPDIR=%t TEMP=%t TMP=%t \
14-
// RUN: %clang -fsycl %t_main.o -foffload-static-lib=%t_lib.a
15-
// RUN: not ls %t/*
16-
#ifdef BUILD_A
17-
const int VAL = 10;
18-
extern int run_test_b(int);
19-
20-
int run_test_a(int v) {
21-
return v*4;
22-
}
23-
24-
int main(int argc, char **argv) {
25-
run_test_a(VAL);
26-
run_test_b(VAL);
27-
return 0;
28-
}
29-
#endif // BUILD_A
30-
#if BUILD_B
31-
int run_test_b(int v) {
32-
return v*3;
33-
}
34-
#endif // BUILD_B
35-
2+
// Test temp file cleanup
3+
// RUN: touch %t_obj.o
4+
// RUN: touch %t_lib.a
5+
// RUN: mkdir -p %t_dir
6+
// invoke the compiler overriding output temp location
7+
// RUN: env TMPDIR=%t_dir TEMP=%t_dir TMP=%t_dir \
8+
// RUN: %clang -target x86_64-unknown-linux-gnu -### -fsycl %t_obj.o -foffload-static-lib=%t_lib.a 2>&1 | \
9+
// RUN: FileCheck -DDIRNAME=%t_dir --check-prefix=CHECK-TEMPFILE %s
10+
// RUN: not ls %t_dir/*
11+
// CHECK-TEMPFILE: clang-offload-bundler{{.*}} "-type=oo" "-targets=host-x86_64-unknown-linux-gnu,sycl-spir64-unknown-{{linux|windows}}-sycldevice" "-inputs=[[DIRNAME]]{{.*}}" "-outputs={{.*}},[[DIRNAME]]{{\/|\\}}[[OUTPUT3:.+\.txt]]" "-unbundle"
12+
// CHECK-TEMPFILE: llvm-link{{.*}} "@[[DIRNAME]]{{\/|\\}}[[OUTPUT3]]"

0 commit comments

Comments
 (0)