1 ; RUN: split-file %s %t
2 ; RUN: not llvm-link %t/a.ll %t/b.ll 2>&1 | FileCheck --check-prefix=CHECK-KIND %s
3 ; RUN: not llvm-link %t/c.ll %t/d.ll 2>&1 | FileCheck --check-prefix=CHECK-REG %s
4 ; RUN: not llvm-link %t/e.ll %t/f.ll 2>&1 | FileCheck --check-prefix=CHECK-OFFSET %s
5 ; RUN: llvm-link %t/g.ll %t/h.ll
7 ; CHECK-KIND: error: linking module flags 'stack-protector-guard': IDs have conflicting values
8 ; CHECK-REG: error: linking module flags 'stack-protector-guard-reg': IDs have conflicting values
9 ; CHECK-OFFSET: error: linking module flags 'stack-protector-guard-offset': IDs have conflicting values
12 ; Test that different values of stack-protector-guard fail.
13 define void @foo() sspstrong {
16 !llvm.module.flags = !{!0}
17 !0 = !{i32 1, !"stack-protector-guard", !"sysreg"}
19 declare void @foo() sspstrong
20 define void @bar() sspstrong {
24 !llvm.module.flags = !{!0}
25 !0 = !{i32 1, !"stack-protector-guard", !"global"}
28 ; Test that different values of stack-protector-guard-reg fail.
29 define void @foo() sspstrong {
32 !llvm.module.flags = !{!0}
33 !0 = !{i32 1, !"stack-protector-guard-reg", !"sp_el0"}
35 declare void @foo() sspstrong
36 define void @bar() sspstrong {
40 !llvm.module.flags = !{!0}
41 !0 = !{i32 1, !"stack-protector-guard-reg", !"sp_el1"}
44 ; Test that different values of stack-protector-guard-offset fail.
45 define void @foo() sspstrong {
48 !llvm.module.flags = !{!0}
49 !0 = !{i32 1, !"stack-protector-guard-offset", i32 257}
51 declare void @foo() sspstrong
52 define void @bar() sspstrong {
56 !llvm.module.flags = !{!0}
57 !0 = !{i32 1, !"stack-protector-guard-offset", i32 256}
60 ; Test that the same values for the three module attributes succeed.
61 define void @foo() sspstrong {
64 !llvm.module.flags = !{!0, !1, !2}
65 !0 = !{i32 1, !"stack-protector-guard", !"sysreg"}
66 !1 = !{i32 1, !"stack-protector-guard-reg", !"sp_el0"}
67 !2 = !{i32 1, !"stack-protector-guard-offset", i32 257}
69 declare void @foo() sspstrong
70 define void @bar() sspstrong {
74 !llvm.module.flags = !{!0, !1, !2}
75 !0 = !{i32 1, !"stack-protector-guard", !"sysreg"}
76 !1 = !{i32 1, !"stack-protector-guard-reg", !"sp_el0"}
77 !2 = !{i32 1, !"stack-protector-guard-offset", i32 257}