Ok built it correctly this time. No crash with Mesa git and LLVM 7 the sample runs fine on my RX580. Possible there is a bug in LLVM 6.