1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals
2 ; Check that when argument promotion changes a function in some parent node of
3 ; the call graph, any analyses that happened to be cached for that function are
4 ; actually invalidated. We are using `demanded-bits` here because when printed
5 ; it will end up caching a value for every instruction, making it easy to
6 ; detect the instruction-level changes that will fail here. With improper
7 ; invalidation this will crash in the second printer as it tries to reuse
8 ; now-invalid demanded bits.
10 ; RUN: opt < %s -passes='function(print<demanded-bits>),attributor,function(print<demanded-bits>)' -S | FileCheck %s
15 ; CHECK: @G = constant i32 0
17 define internal i32 @a(ptr %x) {
24 ; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none)
25 ; CHECK-LABEL: define {{[^@]+}}@b
26 ; CHECK-SAME: () #[[ATTR0:[0-9]+]] {
28 ; CHECK-NEXT: ret i32 0
31 %v = call i32 @a(ptr @G)
36 ; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none)
37 ; CHECK-LABEL: define {{[^@]+}}@c
38 ; CHECK-SAME: () #[[ATTR0]] {
40 ; CHECK-NEXT: ret i32 0
43 %v1 = call i32 @a(ptr @G)
45 %result = add i32 %v1, %v2
49 ; CHECK: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) }