27 lines · plain
1; RUN: opt -passes=function-attrs -stats -disable-output %s 2>&1 | FileCheck %s2 3; REQUIRES: asserts4 5@g = global i32 206 7define i32 @test_only_read_arg(ptr %ptr) {8entry:9 %l = load i32, ptr %ptr10 ret i32 %l11}12 13define void @test_write_global() {14entry:15 store i32 0, ptr @g16 ret void17}18 19; CHECK: 1 function-attrs - Number of arguments marked captures(none)20; CHECK-NEXT: 2 function-attrs - Number of functions with improved memory attribute21; CHECK-NEXT: 1 function-attrs - Number of functions marked as nofree22; CHECK-NEXT: 2 function-attrs - Number of functions marked as norecurse23; CHECK-NEXT: 2 function-attrs - Number of functions marked as nosync24; CHECK-NEXT: 2 function-attrs - Number of functions marked as nounwind25; CHECK-NEXT: 1 function-attrs - Number of arguments marked readonly26; CHECK-NEXT: 2 function-attrs - Number of functions marked as willreturn27