llvm-project/clang/test/CodeGen/target-features-error-4.c
Abhishek Kaushik c6bcc74775
[Clang]Throw frontend error for target feature mismatch when using flatten attribute (#154801)
Fixes #149866

---------

Co-authored-by: Aaron Ballman <aaron@aaronballman.com>
2025-08-25 17:10:00 +05:30

13 lines
495 B
C

// RUN: %clang_cc1 %s -triple=x86_64-linux-gnu -emit-llvm -verify -o /dev/null
typedef double __v2df __attribute__((__vector_size__(16)));
__v2df __attribute__((target("sse4.1"))) foo() {
__v2df v = {0.0, 0.0};
return __builtin_ia32_roundpd(v, 2);
}
__v2df __attribute__((target("no-sse4.1"), flatten)) bar() {
return foo(); // expected-error {{flatten function 'bar' calls 'foo' which requires target feature 'sse4.1', but the caller is compiled without support for 'sse4.1'}}
}