brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.6 KiB · eee4e38 Raw
51 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals2; Check that when argument promotion changes a function in some parent node of3; the call graph, any analyses that happened to be cached for that function are4; actually invalidated. We are using `demanded-bits` here because when printed5; it will end up caching a value for every instruction, making it easy to6; detect the instruction-level changes that will fail here. With improper7; invalidation this will crash in the second printer as it tries to reuse8; now-invalid demanded bits.9;10; RUN: opt < %s -passes='function(print<demanded-bits>),attributor,function(print<demanded-bits>)' -S | FileCheck %s11 12@G = constant i32 013 14;.15; CHECK: @G = constant i32 016;.17define internal i32 @a(ptr %x) {18entry:19  %v = load i32, ptr %x20  ret i32 %v21}22 23define i32 @b() {24; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none)25; CHECK-LABEL: define {{[^@]+}}@b26; CHECK-SAME: () #[[ATTR0:[0-9]+]] {27; CHECK-NEXT:  entry:28; CHECK-NEXT:    ret i32 029;30entry:31  %v = call i32 @a(ptr @G)32  ret i32 %v33}34 35define i32 @c() {36; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none)37; CHECK-LABEL: define {{[^@]+}}@c38; CHECK-SAME: () #[[ATTR0]] {39; CHECK-NEXT:  entry:40; CHECK-NEXT:    ret i32 041;42entry:43  %v1 = call i32 @a(ptr @G)44  %v2 = call i32 @b()45  %result = add i32 %v1, %v246  ret i32 %result47}48;.49; CHECK: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) }50;.51