forked from intel/llvm
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsycl-intelfpga-static-lib.cpp
More file actions
40 lines (36 loc) · 2.26 KB
/
Copy pathsycl-intelfpga-static-lib.cpp
File metadata and controls
40 lines (36 loc) · 2.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
///
/// tests specific to -fintelfpga -fsycl w/ static libs
///
// REQUIRES: clang-driver
// make dummy archive
// Build a fat static lib that will be used for all tests
// RUN: echo "void foo(void) {}" > %t1.cpp
// RUN: %clangxx -target x86_64-unknown-linux-gnu -fintelfpga -fsycl %t1.cpp -c -o %t1_bundle.o
// RUN: llvm-ar cr %t.a %t1_bundle.o
/// Check phases with static lib
// RUN: %clangxx -target x86_64-unknown-linux-gnu -fsycl -fno-sycl-device-lib=all -fintelfpga %t.a -ccc-print-phases 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK_PHASES %s
// CHECK_PHASES: 0: input, "[[INPUT:.+\.a]]", object, (host-sycl)
// CHECK_PHASES: 1: linker, {0}, image, (host-sycl)
// CHECK_PHASES: 2: linker, {0}, image, (host-sycl)
// CHECK_PHASES: 3: clang-offload-deps, {2}, ir, (host-sycl)
// CHECK_PHASES: 4: input, "[[INPUT]]", archive
// CHECK_PHASES: 5: clang-offload-unbundler, {4}, archive
// CHECK_PHASES: 6: linker, {3, 5}, ir, (device-sycl)
// CHECK_PHASES: 7: sycl-post-link, {6}, ir, (device-sycl)
// CHECK_PHASES: 8: llvm-spirv, {7}, spirv, (device-sycl)
// CHECK_PHASES: 9: input, "[[INPUT]]", archive
// CHECK_PHASES: 10: clang-offload-unbundler, {9}, fpga_dependencies_list
// CHECK_PHASES: 11: backend-compiler, {8, 10}, fpga_aocx, (device-sycl)
// CHECK_PHASES: 12: clang-offload-wrapper, {11}, object, (device-sycl)
// CHECK_PHASES: 13: offload, "host-sycl (x86_64-unknown-linux-gnu)" {1}, "device-sycl (spir64_fpga-unknown-unknown-sycldevice)" {12}, image
/// Check for unbundle and use of deps in static lib
// RUN: %clangxx -target x86_64-unknown-linux-gnu -fsycl -fno-sycl-device-lib=all -fintelfpga %t.a -### 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK_UNBUNDLE %s
// CHECK_UNBUNDLE: clang-offload-bundler" "-type=aoo" "-targets=sycl-fpga_dep" "-inputs={{.*}}" "-outputs=[[DEPFILES:.+\.txt]]" "-unbundle"
// CHECK_UNBUNDLE: aoc{{.*}} "-dep-files=@[[DEPFILES]]"
/// Check for no unbundle and use of deps in static lib when using triple
// RUN: %clangxx -target x86_64-unknown-linux-gnu -fsycl -fno-sycl-device-lib=all -fsycl-targets=spir64_fpga-unknown-unknown-sycldevice %t.a -### 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK_NO_UNBUNDLE %s
// CHECK_NO_UNBUNDLE-NOT: clang-offload-bundler" "-type=aoo" "-targets=sycl-fpga_dep"
// CHECK_NO_UNBUNDLE-NOT: aoc{{.*}} "-dep-files={{.*}}"