78 lines · plain
1; RUN: split-file %s %t2; RUN: not llvm-link %t/a.ll %t/b.ll 2>&1 | FileCheck --check-prefix=CHECK-KIND %s3; RUN: not llvm-link %t/c.ll %t/d.ll 2>&1 | FileCheck --check-prefix=CHECK-REG %s4; RUN: not llvm-link %t/e.ll %t/f.ll 2>&1 | FileCheck --check-prefix=CHECK-OFFSET %s5; RUN: llvm-link %t/g.ll %t/h.ll6 7; CHECK-KIND: error: linking module flags 'stack-protector-guard': IDs have conflicting values8; CHECK-REG: error: linking module flags 'stack-protector-guard-reg': IDs have conflicting values9; CHECK-OFFSET: error: linking module flags 'stack-protector-guard-offset': IDs have conflicting values10 11;--- a.ll12; Test that different values of stack-protector-guard fail.13define void @foo() sspstrong {14 ret void15}16!llvm.module.flags = !{!0}17!0 = !{i32 1, !"stack-protector-guard", !"sysreg"}18;--- b.ll19declare void @foo() sspstrong20define void @bar() sspstrong {21 call void @foo()22 ret void23}24!llvm.module.flags = !{!0}25!0 = !{i32 1, !"stack-protector-guard", !"global"}26 27;--- c.ll28; Test that different values of stack-protector-guard-reg fail.29define void @foo() sspstrong {30 ret void31}32!llvm.module.flags = !{!0}33!0 = !{i32 1, !"stack-protector-guard-reg", !"sp_el0"}34;--- d.ll35declare void @foo() sspstrong36define void @bar() sspstrong {37 call void @foo()38 ret void39}40!llvm.module.flags = !{!0}41!0 = !{i32 1, !"stack-protector-guard-reg", !"sp_el1"}42 43;--- e.ll44; Test that different values of stack-protector-guard-offset fail.45define void @foo() sspstrong {46 ret void47}48!llvm.module.flags = !{!0}49!0 = !{i32 1, !"stack-protector-guard-offset", i32 257}50;--- f.ll51declare void @foo() sspstrong52define void @bar() sspstrong {53 call void @foo()54 ret void55}56!llvm.module.flags = !{!0}57!0 = !{i32 1, !"stack-protector-guard-offset", i32 256}58 59;--- g.ll60; Test that the same values for the three module attributes succeed.61define void @foo() sspstrong {62 ret void63}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}68;--- h.ll69declare void @foo() sspstrong70define void @bar() sspstrong {71 call void @foo()72 ret void73}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}78