def METHOD_NAME():
    """Verify that a useful error message is produced if unquoted compiler flags are
    provided."""
    # This should fail during parsing, since /usr/include is interpreted as a spec hash.
    with pytest.raises(spack.error.SpackError) as cm:
        # We don't try to figure out how many following args were intended to be part of
        # cflags, we just explain how to fix it for the immediate next arg.
        spec("gcc cflags=-Os -pipe -other-arg-that-gets-ignored cflags=-I /usr/include")
    # Verify that the generated error message is nicely formatted.
    expected_message = dedent(
        '''\
    Some compiler or linker flags were provided without quoting their arguments,
    which now causes spack to try to parse the *next* argument as a spec component
    such as a variant instead of an additional compiler or linker flag. If the
    intent was to set multiple flags, try quoting them together as described below.
    Possible flag quotation errors (with the correctly-quoted version after the =>):
    (1) cflags=-Os -pipe => cflags="-Os -pipe"
    (2) cflags=-I /usr/include => cflags="-I /usr/include"'''
    )
    assert expected_message in str(cm.value)
    # Verify that the same unquoted cflags report is generated in the error message even
    # if it fails during concretization, not just during parsing.
    with pytest.raises(spack.error.SpackError) as cm:
        spec("gcc cflags=-Os -pipe")
    cm = str(cm.value)
    assert cm.startswith(
        'trying to set variant "pipe" in package "gcc", but the package has no such '
        'variant [happened during concretization of gcc cflags="-Os" ~pipe]'
    )
    assert cm.endswith('(1) cflags=-Os -pipe => cflags="-Os -pipe"')