|
27 | 27 | // ELF-WARNING: is not an ELF image, so notes cannot be added to it.
|
28 | 28 | // CHECK-IR: target triple = "x86_64-pc-linux-gnu"
|
29 | 29 |
|
30 |
| -// CHECK-IR-DAG: [[ENTTY:%.+]] = type { ptr, ptr, i{{32|64}}, i32, i32 } |
| 30 | +// CHECK-IR-DAG: [[ENTTY:%.+]] = type { i64, i16, i16, i32, ptr, ptr, i64, i64, ptr } |
31 | 31 | // CHECK-IR-DAG: [[IMAGETY:%.+]] = type { ptr, ptr, ptr, ptr }
|
32 | 32 | // CHECK-IR-DAG: [[DESCTY:%.+]] = type { i32, ptr, ptr, ptr }
|
33 |
| - |
34 |
| -// CHECK-IR: [[ENTBEGIN:@.+]] = external hidden constant [[ENTTY]] |
35 |
| -// CHECK-IR: [[ENTEND:@.+]] = external hidden constant [[ENTTY]] |
36 |
| - |
37 |
| -// CHECK-IR: [[DUMMY:@.+]] = weak hidden constant [0 x [[ENTTY]]] zeroinitializer, section "omp_offloading_entries" |
| 33 | +// |
| 34 | +// CHECK-IR: [[ENTBEGIN:@.+]] = external hidden constant [0 x [[ENTTY]]] |
| 35 | +// CHECK-IR: [[ENTEND:@.+]] = external hidden constant [0 x [[ENTTY]]] |
| 36 | +// CHECK-IR: [[DUMMY:@.+]] = internal constant [0 x [[ENTTY]]] zeroinitializer, section "llvm_offload_entries", align 8 |
| 37 | +// CHECK-IR: @llvm.compiler.used = appending global [1 x ptr] [ptr [[DUMMY]]], section "llvm.metadata" |
38 | 38 |
|
39 | 39 | // CHECK-IR: [[BIN:@.+]] = internal unnamed_addr constant [[[SIZE:[0-9]+]] x i8] c"\10\FF\10\AD{{.*}}"
|
40 |
| - |
41 |
| -// CHECK-IR: [[IMAGES:@.+]] = internal unnamed_addr constant [1 x [[IMAGETY]]] [[[IMAGETY]] { ptr [[BIN]], ptr getelementptr ([[[SIZE]] x i8], ptr [[BIN]], i64 0, i64 160), ptr [[ENTBEGIN]], ptr [[ENTEND]] }] |
42 |
| - |
| 40 | + ffloading.device_image = internal unnamed_addr constant [[[SIZE]] x i8] c"\10\FF\10\AD\01\00\00\0 |
| 41 | +// CHECK-IR: [[IMAGES:@.+]] = internal unnamed_addr constant [1 x %__tgt_device_image] [%__tgt_device_image { ptr getelementptr ([[[SIZE]] x i8], ptr [[BIN]], i64 0, i64 136), ptr getelementptr ([[[SIZE]] x i8], ptr [[BIN]], i64 0, i64 159), ptr [[ENTBEGIN]], ptr [[ENTEND]] }] |
43 | 42 | // CHECK-IR: [[DESC:@.+]] = internal constant [[DESCTY]] { i32 1, ptr [[IMAGES]], ptr [[ENTBEGIN]], ptr [[ENTEND]] }
|
| 43 | +// CHECK-IR: @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 101, ptr [[REGFN:@.+]], ptr null }] |
44 | 44 |
|
45 |
| -// CHECK-IR: @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 1, ptr [[REGFN:@.+]], ptr null }] |
46 |
| - |
47 |
| -// CHECK-IR: define internal void [[REGFN]]() |
| 45 | +// CHECK-IR: define internal void [[REGFN]]() section ".text.startup" { |
48 | 46 | // CHECK-IR: call void @__tgt_register_lib(ptr [[DESC]])
|
| 47 | +// CHECK-IR: %0 = call i32 @atexit(ptr @.omp_offloading.descriptor_unreg) |
49 | 48 | // CHECK-IR: ret void
|
| 49 | +// CHECK-IR: } |
50 | 50 |
|
51 | 51 | // CHECK-IR: declare void @__tgt_register_lib(ptr)
|
52 | 52 |
|
| 53 | +// CHECK-IR: declare i32 @atexit(ptr) |
| 54 | + |
| 55 | +// CHECK-IR: define internal void [[DESC]]_unreg() section ".text.startup" { |
53 | 56 | // CHECK-IR: call void @__tgt_unregister_lib(ptr [[DESC]])
|
54 | 57 | // CHECK-IR: ret void
|
| 58 | +// CHECK-IR: } |
55 | 59 |
|
56 |
| -// CHECK-IR: declare void @__tgt_unregister_lib(ptr) |
| 60 | +// CHECK_IR: declare void @__tgt_unregister_lib(ptr) |
57 | 61 |
|
58 | 62 | // Check that clang-offload-wrapper adds LLVMOMPOFFLOAD notes
|
59 | 63 | // into the ELF offload images:
|
|
0 commit comments