Add support for `__builtin_stack_address` builtin. The semantics match those of GCC's builtin with the same name. `__builtin_stack_address` returns the starting address of the stack region that may be used by called functions. It may or may not include the space used for on-stack arguments passed to a callee (See [GCC Bug/121013](https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121013)). Fixes #82632.
8 lines
191 B
C
8 lines
191 B
C
// RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck %s
|
|
|
|
// CHECK-LABEL: define {{[^@]+}} @a()
|
|
// CHECK: call {{[^@]+}} @llvm.stackaddress.p0()
|
|
void *a() {
|
|
return __builtin_stack_address();
|
|
}
|