Skip to content

Commit 4a7786b

Browse files
author
aidan.belton
committed
Add test for sycl-post-link removing llvm.used
1 parent 0cff819 commit 4a7786b

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// RUN: %clang_cc1 -disable-llvm-passes %s -emit-llvm -o - | sycl-post-link -split=auto -ir-output-only -o %t.out_ir_only.bc
2+
// RUN: llvm-dis %t.out_ir_only.bc -o %t.out_ir_only.ll
3+
// RUN: FileCheck %s --input-file %t.out_ir_only.ll
4+
//
5+
// RUN: %clang_cc1 -disable-llvm-passes %s -emit-llvm -o %t.out.bc
6+
// RUN: sycl-post-link -split=auto -symbols -split-esimd -lower-esimd -O2 -spec-const=default %t.out.bc -o %t.out.table
7+
// RUN: llvm-dis "$(sed -n '2p' %t.out.table | sed 's/|.*//')" -o %t.out.ll
8+
// RUN: FileCheck %s --input-file %t.out.ll
9+
// CHECK-NOT: @llvm.used
10+
11+
struct a;
12+
class g {
13+
public:
14+
int c;
15+
~g();
16+
};
17+
template <class>
18+
class h {
19+
public:
20+
static const void k();
21+
static g i;
22+
};
23+
template <class j>
24+
const void h<j>::k() { i.c = 0; }
25+
template <class j>
26+
g h<j>::i;
27+
template <class>
28+
struct f { f() __attribute__((used)); };
29+
template <class j>
30+
f<j>::f() { h<j>::k(); }
31+
template struct f<a>;

0 commit comments

Comments
 (0)