1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals
2 ; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,TUNIT
3 ; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC
5 define void @non_recursive_asm_fn() #0 {
6 ; CHECK: Function Attrs: norecurse
7 ; CHECK-LABEL: define {{[^@]+}}@non_recursive_asm_fn
8 ; CHECK-SAME: () #[[ATTR0:[0-9]+]] {
10 ; CHECK-NEXT: call void asm sideeffect "barrier.sync $0
11 ; CHECK-NEXT: ret void
14 call void asm sideeffect "barrier.sync $0;", "r,~{memory},~{dirflag},~{fpsr},~{flags}"(i32 1)
18 define void @non_recursive_asm_cs() {
19 ; CHECK: Function Attrs: norecurse
20 ; CHECK-LABEL: define {{[^@]+}}@non_recursive_asm_cs
21 ; CHECK-SAME: () #[[ATTR1:[0-9]+]] {
23 ; CHECK-NEXT: call void asm sideeffect "barrier.sync $0
24 ; CHECK-NEXT: ret void
27 call void asm sideeffect "barrier.sync $0;", "r,~{memory},~{dirflag},~{fpsr},~{flags}"(i32 1) #0
31 define void @non_recursive_asm_no_sideffect() {
32 ; CHECK: Function Attrs: norecurse
33 ; CHECK-LABEL: define {{[^@]+}}@non_recursive_asm_no_sideffect
34 ; CHECK-SAME: () #[[ATTR1]] {
36 ; CHECK-NEXT: call void asm "foobar
37 ; CHECK-NEXT: ret void
40 call void asm "foobar;", ""()
44 define void @recursive_asm() {
45 ; CHECK-LABEL: define {{[^@]+}}@recursive_asm() {
47 ; CHECK-NEXT: call void asm sideeffect "barrier.sync $0
48 ; CHECK-NEXT: ret void
51 call void asm sideeffect "barrier.sync $0;", "r,~{memory},~{dirflag},~{fpsr},~{flags}"(i32 1)
55 attributes #0 = { "llvm.assume"="ompx_no_call_asm" }
57 ; CHECK: attributes #[[ATTR0]] = { norecurse "llvm.assume"="ompx_no_call_asm" }
58 ; CHECK: attributes #[[ATTR1]] = { norecurse }
59 ; CHECK: attributes #[[ATTR2:[0-9]+]] = { "llvm.assume"="ompx_no_call_asm" }
61 ;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line: