| 1 |
// RUN: %occ-cli %s --cl-options="-g -s ./tmp/kernel.cl" --cl-device=%cl_device %cfg_path --output=%t.bc |
| 2 |
// RUN: llvm-dis < %t.bc | FileCheck %s --check-prefix=CHECK-1 |
| 3 |
|
| 4 |
// CHECK-1: !1 = !DIFile(filename: "tmp/kernel.cl", |
| 5 |
|
| 6 |
// absolute path |
| 7 |
|
| 8 |
// RUN: %occ-cli %s --cl-options="-g -s /tmp/kernel.cl" --cl-device=%cl_device %cfg_path --output=%t.bc |
| 9 |
// RUN: llvm-dis < %t.bc | FileCheck %s --check-prefix=CHECK-2 |
| 10 |
|
| 11 |
// CHECK-2: !1 = !DIFile(filename: "/tmp/kernel.cl", |
| 12 |
|
| 13 |
// more complicated test cases |
| 14 |
|
| 15 |
// RUN: %occ-cli %s --cl-options="-g -s ./tmp/../tmp/../tmp/kernel.cl" --cl-device=%cl_device %cfg_path --output=%t.bc |
| 16 |
// RUN: llvm-dis < %t.bc | FileCheck %s --check-prefix=CHECK-3 |
| 17 |
|
| 18 |
// CHECK-3: !1 = !DIFile(filename: "tmp/../tmp/../tmp/kernel.cl", |
| 19 |
|
| 20 |
// RUN: %occ-cli %s --cl-options="-g -s /tmp/../tmp/../tmp/kernel.cl" --cl-device=%cl_device %cfg_path --output=%t.bc |
| 21 |
// RUN: llvm-dis < %t.bc | FileCheck %s --check-prefix=CHECK-4 |
| 22 |
|
| 23 |
// CHECK-4: !1 = !DIFile(filename: "/tmp/../tmp/../tmp/kernel.cl", |
| 24 |
|
| 25 |
// test cases with spaces |
| 26 |
|
| 27 |
// RUN: %occ-cli %s --cl-options='-g -s "/path with spaces/kernel.cl"' --cl-device=%cl_device %cfg_path --output=%t.bc |
| 28 |
// RUN: llvm-dis < %t.bc | FileCheck %s --check-prefix=CHECK-6 |
| 29 |
|
| 30 |
// CHECK-6: !1 = !DIFile(filename: "/path with spaces/kernel.cl", |
| 31 |
|
| 32 |
// RUN: %occ-cli %s --cl-options="-g -s /path\ with\ spaces/kernel.cl" --cl-device=%cl_device %cfg_path --output=%t.bc |
| 33 |
// RUN: llvm-dis < %t.bc | FileCheck %s --check-prefix=CHECK-7 |
| 34 |
|
| 35 |
// CHECK-7: !1 = !DIFile(filename: "/path with spaces/kernel.cl", |
| 36 |
|
| 37 |
// non-ascii characters |
| 38 |
|
| 39 |
// RUN: %occ-cli %s --cl-options="-g -s /tmp/❶❷❸❹❺❻❼❽❾❿.cl" --cl-device=%cl_device %cfg_path --output=%t.bc |
| 40 |
// RUN: llvm-dis < %t.bc | FileCheck %s --check-prefix=CHECK-8 |
| 41 |
|
| 42 |
// CHECK-8: !1 = !DIFile(filename: "/tmp/\E2\9D\B6\E2\9D\B7\E2\9D\B8\E2\9D\B9\E2\9D\BA\E2\9D\BB\E2\9D\BC\E2\9D\BD\E2\9D\BE\E2\9D\BF.cl", |
| 43 |
|
| 44 |
// multiply slashes |
| 45 |
|
| 46 |
// RUN: %occ-cli %s --cl-options="-g -s /tmp//path///to//kernel.cl" --cl-device=%cl_device %cfg_path --output=%t.bc |
| 47 |
// RUN: llvm-dis < %t.bc | FileCheck %s --check-prefix=CHECK-9 |
| 48 |
|
| 49 |
// Clang normalizes only the last segment. |
| 50 |
// CHECK-9: !1 = !DIFile(filename: "/tmp//path///to/kernel.cl", |
| 51 |
|
| 52 |
__kernel void test(__global int *text) { |
| 53 |
int gid = get_global_id(0); |
| 54 |
text[gid] += gid; |
| 55 |
} |