xref: /llvm-project/llvm/test/CodeGen/X86/attr-dontcall.ll (revision 155e0cf5dc2ffba0a509b1dea25fb4c31eeb367e)
1; RUN: not llc -mtriple=x86_64 -global-isel=0 -fast-isel=0 -stop-after=finalize-isel < %s 2>&1 | FileCheck %s
2; RUN: not llc -mtriple=x86_64 -global-isel=0 -fast-isel=1 -stop-after=finalize-isel < %s 2>&1 | FileCheck %s
3; RUN: not llc -mtriple=x86_64 -global-isel=1 -fast-isel=0 -stop-after=irtranslator -global-isel-abort=0 < %s 2>&1 | FileCheck %s
4
5declare void @foo() "dontcall-error"="e"
6define void @bar() {
7  call void @foo()
8  ret void
9}
10
11declare void @foo2() "dontcall-warn"="w"
12define void @bar2() {
13  call void @foo2()
14  ret void
15}
16
17declare void @foo3() "dontcall-warn"
18define void @bar3() {
19  call void @foo3()
20  ret void
21}
22
23declare void @foo4(i32) addrspace(1) "dontcall-warn"="cast"
24
25define void @bar4() {
26  call void addrspacecast (ptr addrspace(1) @foo4 to ptr)(i32 0)
27  ret void
28}
29
30declare i32 @_Z3fooi(i32) "dontcall-error"
31define void @demangle1() {
32  call i32 @_Z3fooi (i32 0)
33  ret void
34}
35declare float @_Z3barf(float) "dontcall-error"
36define void @demangle2() {
37  call float @_Z3barf(float 0.0)
38  ret void
39}
40
41declare i32 @_RNvC1a3baz() "dontcall-error"
42define void @demangle3() {
43  call i32 @_RNvC1a3baz()
44  ret void
45}
46
47
48declare i32 @_Z3fooILi79EEbU7_ExtIntIXT_EEi(i32) "dontcall-error"
49define void @demangle4() {
50  call i32 @_Z3fooILi79EEbU7_ExtIntIXT_EEi(i32 0)
51  ret void
52}
53; CHECK: error: call to foo marked "dontcall-error": e
54; CHECK: warning: call to foo2 marked "dontcall-warn": w
55; CHECK: warning: call to foo3 marked "dontcall-warn"{{$}}
56; CHECK: warning: call to foo4 marked "dontcall-warn": cast
57; CHECK: error: call to foo(int) marked "dontcall-error"
58; CHECK: error: call to bar(float) marked "dontcall-error"
59; CHECK: error: call to a::baz marked "dontcall-error"
60; CHECK: error: call to bool foo<79>(int _ExtInt<79>) marked "dontcall-error"
61