xref: /llvm-project/llvm/test/Transforms/Attributor/ArgumentPromotion/pr27568.ll (revision cd3a4c31bc9694d160de54c6a4daa53e152cb463)
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
4target triple = "x86_64-pc-windows-msvc"
5
6define internal void @callee(ptr) {
7; CHECK: Function Attrs: memory(readwrite, argmem: none)
8; CHECK-LABEL: define {{[^@]+}}@callee
9; CHECK-SAME: () #[[ATTR0:[0-9]+]] {
10; CHECK-NEXT:  entry:
11; CHECK-NEXT:    call void @thunk()
12; CHECK-NEXT:    ret void
13;
14entry:
15  call void @thunk()
16  ret void
17}
18
19define void @test1() personality ptr @__CxxFrameHandler3 {
20; CHECK-LABEL: define {{[^@]+}}@test1() personality ptr @__CxxFrameHandler3 {
21; CHECK-NEXT:  entry:
22; CHECK-NEXT:    invoke void @thunk()
23; CHECK-NEXT:            to label [[OUT:%.*]] unwind label [[CPAD:%.*]]
24; CHECK:       out:
25; CHECK-NEXT:    ret void
26; CHECK:       cpad:
27; CHECK-NEXT:    [[PAD:%.*]] = cleanuppad within none []
28; CHECK-NEXT:    call void @callee() [ "funclet"(token [[PAD]]) ]
29; CHECK-NEXT:    cleanupret from [[PAD]] unwind to caller
30;
31entry:
32  invoke void @thunk()
33  to label %out unwind label %cpad
34
35out:
36  ret void
37
38cpad:
39  %pad = cleanuppad within none []
40  call void @callee(ptr null) [ "funclet"(token %pad) ]
41  cleanupret from %pad unwind to caller
42}
43
44
45declare void @thunk()
46
47declare i32 @__CxxFrameHandler3(...)
48;.
49; CHECK: attributes #[[ATTR0]] = { memory(readwrite, argmem: none) }
50;.
51;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:
52; CGSCC: {{.*}}
53; TUNIT: {{.*}}
54