Index: test/CodeGen/ms-inline-asm-avx512-relaxations.c =================================================================== --- test/CodeGen/ms-inline-asm-avx512-relaxations.c +++ test/CodeGen/ms-inline-asm-avx512-relaxations.c @@ -0,0 +1,19 @@ +// RUN: %clang_cc1 %s -triple x86_64-unknown-linux-gnu -emit-llvm -target-cpu skylake-avx512 -fasm-blocks -o - | FileCheck %s + +// Minimal reproducer +// Case1: Check integrity of inspected patch upon broadcasting +// Case2: Check integrity of inspected patch upon SIMD mem ref +// Case3: Check we don't mess up with non-SIMD mem ref +// Case4: Check non-AVX512 insts aren't affected + +void F() { + char a; + // CHECK: vaddps xmm1, xmm2, dword ptr $0{1to4} + // CHECK: vaddps xmm1, xmm2, xmmword ptr $1 + // CHECK: vcomiss xmm1, byte ptr $2 + // CHECK: mov rax, byte ptr $3 + __asm vaddps xmm1, xmm2, [a]{1to4} + __asm vaddps xmm1, xmm2, [a] + __asm vcomiss xmm1, [a] + __asm mov rax, [a] +}