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 ; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s --try-experimental-debuginfo-iterators | FileCheck %s --check-prefixes=CHECK,TUNIT
6 ; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s --try-experimental-debuginfo-iterators | FileCheck %s --check-prefixes=CHECK,CGSCC
8 ; Fix for PR33641. ArgumentPromotion removed the argument to bar but left the call to
9 ; dbg.value which still used the removed argument.
11 ; The %p argument should be removed, and the use of it in dbg.value should be
18 ; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none)
19 ; CHECK-LABEL: define {{[^@]+}}@foo
20 ; CHECK-SAME: () #[[ATTR0:[0-9]+]] {
21 ; CHECK-NEXT: [[TMP:%.*]] = alloca ptr, align 8
22 ; CHECK-NEXT: ret void
25 store %fun_t @bar, ptr %tmp
29 define internal void @bar(%p_t %p) {
30 ; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none)
31 ; CGSCC-LABEL: define {{[^@]+}}@bar
32 ; CGSCC-SAME: (ptr nocapture nofree readnone [[P:%.*]]) #[[ATTR0]] {
33 ; CGSCC-NEXT: #dbg_value(ptr [[P]], [[META3:![0-9]+]], !DIExpression(), [[META5:![0-9]+]])
34 ; CGSCC-NEXT: ret void
36 call void @llvm.dbg.value(metadata %p_t %p, metadata !4, metadata !5), !dbg !6
40 declare void @llvm.dbg.value(metadata, metadata, metadata)
43 !llvm.module.flags = !{!2}
45 !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1)
46 !1 = !DIFile(filename: "test.c", directory: "")
47 !2 = !{i32 2, !"Debug Info Version", i32 3}
48 !3 = distinct !DISubprogram(name: "bar", unit: !0)
49 !4 = !DILocalVariable(name: "p", scope: !3)
51 !6 = !DILocation(line: 1, column: 1, scope: !3)
53 ; TUNIT: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) }
55 ; CGSCC: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) }
57 ; TUNIT: [[META0:![0-9]+]] = distinct !DICompileUnit(language: DW_LANG_C, file: [[META1:![0-9]+]], isOptimized: false, runtimeVersion: 0, emissionKind: NoDebug)
58 ; TUNIT: [[META1]] = !DIFile(filename: "test.c", directory: "")
59 ; TUNIT: [[META2:![0-9]+]] = !{i32 2, !"Debug Info Version", i32 3}
61 ; CGSCC: [[META0:![0-9]+]] = distinct !DICompileUnit(language: DW_LANG_C, file: [[META1:![0-9]+]], isOptimized: false, runtimeVersion: 0, emissionKind: NoDebug)
62 ; CGSCC: [[META1]] = !DIFile(filename: "test.c", directory: "")
63 ; CGSCC: [[META2:![0-9]+]] = !{i32 2, !"Debug Info Version", i32 3}
64 ; CGSCC: [[META3]] = !DILocalVariable(name: "p", scope: [[META4:![0-9]+]])
65 ; CGSCC: [[META4]] = distinct !DISubprogram(name: "bar", scope: null, spFlags: DISPFlagDefinition, unit: [[META0]])
66 ; CGSCC: [[META5]] = !DILocation(line: 1, column: 1, scope: [[META4]])
68 ;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line: