def test_function_memory_write
    expected = "; Function Attrs: memory(write)\ndeclare void @fun() #0\n"
    with_function [], LLVM.Void do |fun|
      fun.add_attribute(attr_memory(42))
      assert_equal(expected, fun.to_s)