|
19 | 19 | //
|
20 | 20 | // Check bitcode produced by the wrapper tool.
|
21 | 21 | //
|
22 |
| -// RUN: clang-offload-wrapper -target=x86_64-pc-linux-gnu -o %t.wrapper.bc %t.tgt |
| 22 | +// RUN: clang-offload-wrapper -target=x86_64-pc-linux-gnu -o %t.wrapper.bc %t.tgt 2>&1 | FileCheck %s --check-prefix ELF-WARNING |
23 | 23 | // RUN: llvm-dis %t.wrapper.bc -o - | FileCheck %s --check-prefix CHECK-IR
|
24 | 24 |
|
| 25 | +// ELF-WARNING: is not an ELF image, so notes cannot be added to it. |
25 | 26 | // CHECK-IR: target triple = "x86_64-pc-linux-gnu"
|
26 | 27 |
|
27 | 28 | // CHECK-IR-DAG: [[ENTTY:%.+]] = type { i8*, i8*, i{{32|64}}, i32, i32 }
|
|
53 | 54 | // CHECK-IR: ret void
|
54 | 55 |
|
55 | 56 | // CHECK-IR: declare void @__tgt_unregister_lib([[DESCTY]]*)
|
| 57 | + |
| 58 | +// Check that clang-offload-wrapper adds LLVMOMPOFFLOAD notes |
| 59 | +// into the ELF offload images: |
| 60 | +// RUN: yaml2obj %S/Inputs/empty-elf-template.yaml -o %t.64le -DBITS=64 -DENCODING=LSB |
| 61 | +// RUN: clang-offload-wrapper -target=x86_64-pc-linux-gnu -o %t.wrapper.elf64le.bc %t.64le |
| 62 | +// RUN: llvm-dis %t.wrapper.elf64le.bc -o - | FileCheck %s --check-prefix OMPNOTES |
| 63 | +// RUN: yaml2obj %S/Inputs/empty-elf-template.yaml -o %t.64be -DBITS=64 -DENCODING=MSB |
| 64 | +// RUN: clang-offload-wrapper -target=x86_64-pc-linux-gnu -o %t.wrapper.elf64be.bc %t.64be |
| 65 | +// RUN: llvm-dis %t.wrapper.elf64be.bc -o - | FileCheck %s --check-prefix OMPNOTES |
| 66 | +// RUN: yaml2obj %S/Inputs/empty-elf-template.yaml -o %t.32le -DBITS=32 -DENCODING=LSB |
| 67 | +// RUN: clang-offload-wrapper -target=x86_64-pc-linux-gnu -o %t.wrapper.elf32le.bc %t.32le |
| 68 | +// RUN: llvm-dis %t.wrapper.elf32le.bc -o - | FileCheck %s --check-prefix OMPNOTES |
| 69 | +// RUN: yaml2obj %S/Inputs/empty-elf-template.yaml -o %t.32be -DBITS=32 -DENCODING=MSB |
| 70 | +// RUN: clang-offload-wrapper -target=x86_64-pc-linux-gnu -o %t.wrapper.elf32be.bc %t.32be |
| 71 | +// RUN: llvm-dis %t.wrapper.elf32be.bc -o - | FileCheck %s --check-prefix OMPNOTES |
| 72 | + |
| 73 | +// There is no clean way for extracting the offload image |
| 74 | +// from the object file currently, so try to find |
| 75 | +// the inserted ELF notes in the device image variable's |
| 76 | +// initializer: |
| 77 | +// OMPNOTES: @{{.+}} = internal unnamed_addr constant [{{[0-9]+}} x i8] c"{{.*}}LLVMOMPOFFLOAD{{.*}}LLVMOMPOFFLOAD{{.*}}LLVMOMPOFFLOAD{{.*}}" |
0 commit comments