FYI from that page: "Thus the first restriction on early depth tests is that they cannot happen if the fragment shader writes gl_FragDepth. If the fragment shader modifies the depth, then the depth test must wait until after the fragment shader executes."
I'm sorry but you clearly didn't read that entire article, the use of that syntax for forcing early Z requires GL_ARB_shader_image_load_store:
More recent hardware can force early depth tests, using a special fragment shader layout qualifier:layout(early_fragment_tests) in;
This will also perform early stencil tests.
Its mentioned in the spec too:
An explicit control is provided to allow fragment shaders to enable earlyfragment tests. If the fragment shader specifies the
"early_fragment_tests" layout qualifier, the per-fragment tests described
in Section 3.X will be performed prior to fragment shader execution.
Otherwise, they will be performed after fragment shader execution.