mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-30 01:46:05 +00:00

Similar to D72215 (AArch64) and D72220 (x86). ``` % clang -target riscv32 -march=rv64g -c -fpatchable-function-entry=2 a.c && llvm-objdump -dr a.o ... 0000000000000000 <main>: 0: 13 00 00 00 nop 4: 13 00 00 00 nop % clang -target riscv32 -march=rv64gc -c -fpatchable-function-entry=2 a.c && llvm-objdump -dr a.o ... 00000002 <main>: 2: 01 00 nop 4: 01 00 nop ``` Recently the mainline kernel started to use -fpatchable-function-entry=8 for riscv (https://git.kernel.org/linus/afc76b8b80112189b6f11e67e19cf58301944814). Differential Revision: https://reviews.llvm.org/D98610
13 lines
622 B
C++
13 lines
622 B
C++
// RUN: %clang_cc1 -triple aarch64 -fsyntax-only -verify=silence %s
|
|
// RUN: %clang_cc1 -triple aarch64_be -fsyntax-only -verify=silence %s
|
|
// RUN: %clang_cc1 -triple i386 -fsyntax-only -verify=silence %s
|
|
// RUN: %clang_cc1 -triple x86_64 -fsyntax-only -verify=silence %s
|
|
// RUN: %clang_cc1 -triple riscv32 -fsyntax-only -verify=silence %s
|
|
// RUN: %clang_cc1 -triple riscv64 -fsyntax-only -verify=silence %s
|
|
// RUN: %clang_cc1 -triple ppc64le -fsyntax-only -verify %s
|
|
|
|
// silence-no-diagnostics
|
|
|
|
// expected-warning@+1 {{unknown attribute 'patchable_function_entry' ignored}}
|
|
[[gnu::patchable_function_entry(0)]] void f();
|