xref: /llvm-project/llvm/test/ThinLTO/X86/dontcall.ll (revision aa53785f23b2b89a9a423af131697b1f7c92869f)
1; RUN: split-file %s %t
2; RUN: opt -module-summary %t/a.s -o %t/a.bc
3; RUN: opt -module-summary %t/b.s -o %t/b.bc
4; RUN: not llvm-lto2 run %t/a.bc %t/b.bc -o %t/out -save-temps 2>&1 \
5; RUN:   -r=%t/a.bc,callee,px \
6; RUN:   -r=%t/b.bc,callee,x  \
7; RUN:   -r=%t/b.bc,caller,px
8
9; TODO: As part of LTO, we check that types match, but *we don't yet check that
10; attributes match!!! What should happen if we remove "dontcall-error" from the
11; definition or declaration of @callee?
12
13; CHECK: call to callee marked "dontcall-error"
14
15;--- a.s
16target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
17target triple = "x86_64-unknown-linux-gnu"
18
19define i32 @callee() "dontcall-error" noinline {
20  ret i32 42
21}
22
23;--- b.s
24target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
25target triple = "x86_64-unknown-linux-gnu"
26
27declare i32 @callee() "dontcall-error"
28
29define i32 @caller() {
30entry:
31  %0 = call i32 @callee()
32  ret i32 %0
33}
34