Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
f8b004d
[clang][DebugInfo] Don't mark explicit parameter of synthesized ObjC …
Michael137 Oct 27, 2025
2934662
[SimplifyCFG] Precommit tests for PR161807 (NFC)
antoniofrighetto Oct 27, 2025
00f5a1e
[SimplifyCFG] Extend `simplifySwitchOfPowersOfTwo` to reachable defaults
antoniofrighetto Oct 27, 2025
de9e18d
[InstCombine] Handle ptrtoaddr in gep of pointer sub fold (#164818)
nikic Oct 27, 2025
bc37018
[clang][bytecode] Fail on reads from constexpr-unknown pointers (#164…
tbaederr Oct 27, 2025
e86a429
[NVPTX] Add missing mbarrier intrinsics (#164864)
durga4github Oct 27, 2025
aa550cd
[ARM] [AArch32] Add support for Arm China STAR-MC3 CPU (#163709)
AlbertHuang-CPU Oct 27, 2025
efcc613
[Clang][AMDGPU] Enable type-checking on __builtin_amdgcn_raw_ptr_buff…
jmmartinez Oct 27, 2025
cf6db63
[LoongArch] Optimize for reversing vector using shufflevector (#163151)
zhaoqi5 Oct 27, 2025
bcfd6da
[mlir][spirv] Enable validation of global vars tests (#164974)
IgWod-IMG Oct 27, 2025
9af49ee
[clang][bytecode] Handle discarded AddrLabelExprs properly (#165000)
tbaederr Oct 27, 2025
046ed90
[mlir][spirv] Ensure function declarations precede definitions (#164956)
IgWod-IMG Oct 27, 2025
5d1e1cf
[clang][bytecode] Check memcmp for block pointers (#165070)
tbaederr Oct 27, 2025
538c850
[clang][docs] Fix typos in SafeBuffers.rst (#163547)
ivafanas Oct 27, 2025
313b95f
[lldb][test] Add test for parsing Objective-C synthesized properties
Michael137 Oct 27, 2025
33185e7
[lldb][docs] Add example output for standalone debugging script
DavidSpickett Oct 27, 2025
9a39076
[test][DebugInfo] Remove unsafe-fp-math uses (NFC) (#164966)
paperchalice Oct 27, 2025
c40b690
[lldb][test] TestFrameVarDILGlobalVariableLookup: skip for older DWAR…
Michael137 Oct 27, 2025
74bb1f4
[lldb][test] TestFrameVarDILGlobalVariableLookup: XFAIL on older Clan…
Michael137 Oct 27, 2025
60f20ea
[AMDGPU] Add target feature for waits before system scope stores. NFC…
jayfoad Oct 27, 2025
d11f0bc
[clang-tidy] Remove unused #include. NFC.
d0k Oct 27, 2025
67de710
[lldb-dap][test] Disable DisconnectTriggersTerminateCommands on Linux
DavidSpickett Oct 27, 2025
e624048
[clang][bytecode] Check overflow ops for block pointers (#165221)
tbaederr Oct 27, 2025
ff5a737
[lldb][test] TestFrameVarDILGlobalVariableLookup: only XFAIL earlier …
Michael137 Oct 27, 2025
1205c9b
merge main into amd-staging
z1-cciauto Oct 27, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#include "clang/ASTMatchers/ASTMatchers.h"
#include "clang/Basic/Diagnostic.h"
#include "clang/Lex/Lexer.h"
#include "clang/Sema/DeclSpec.h"

using namespace clang::ast_matchers;

Expand Down
4 changes: 2 additions & 2 deletions clang/docs/SafeBuffers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ You can achieve this by refactoring the function to accept a ``std::span``
as a parameter::

int get_last_element(std::span<int> sp) {
return sp[size - 1];
return sp[sp.size() - 1];
}

This solution puts the responsibility for making sure the span is well-formed
Expand Down Expand Up @@ -411,7 +411,7 @@ backwards compatibility -- in terms of both API and ABI -- by adding
a "compatibility overload"::

int get_last_element(std::span<int> sp) {
return sp[size - 1];
return sp[sp.size() - 1];
}

[[clang::unsafe_buffer_usage]] // Please use the new function.
Expand Down
12 changes: 6 additions & 6 deletions clang/include/clang/Basic/BuiltinsAMDGPU.def
Original file line number Diff line number Diff line change
Expand Up @@ -177,15 +177,15 @@ BUILTIN(__builtin_amdgcn_raw_buffer_load_b64, "V2UiQbiiIi", "n")
BUILTIN(__builtin_amdgcn_raw_buffer_load_b96, "V3UiQbiiIi", "n")
BUILTIN(__builtin_amdgcn_raw_buffer_load_b128, "V4UiQbiiIi", "n")

BUILTIN(__builtin_amdgcn_raw_ptr_buffer_atomic_add_i32, "iiQbiiIi", "t")
BUILTIN(__builtin_amdgcn_raw_ptr_buffer_atomic_add_i32, "iiQbiiIi", "")

TARGET_BUILTIN(__builtin_amdgcn_raw_ptr_buffer_atomic_fadd_f32, "ffQbiiIi", "t", "atomic-fadd-rtn-insts")
TARGET_BUILTIN(__builtin_amdgcn_raw_ptr_buffer_atomic_fadd_f32, "ffQbiiIi", "", "atomic-fadd-rtn-insts")
TARGET_BUILTIN(__builtin_amdgcn_raw_ptr_buffer_atomic_fadd_v2f16, "V2hV2hQbiiIi", "t", "atomic-buffer-global-pk-add-f16-insts")

TARGET_BUILTIN(__builtin_amdgcn_raw_ptr_buffer_atomic_fmin_f32, "ffQbiiIi", "t", "atomic-fmin-fmax-global-f32")
TARGET_BUILTIN(__builtin_amdgcn_raw_ptr_buffer_atomic_fmax_f32, "ffQbiiIi", "t", "atomic-fmin-fmax-global-f32")
TARGET_BUILTIN(__builtin_amdgcn_raw_ptr_buffer_atomic_fmin_f64, "ddQbiiIi", "t", "atomic-fmin-fmax-global-f64")
TARGET_BUILTIN(__builtin_amdgcn_raw_ptr_buffer_atomic_fmax_f64, "ddQbiiIi", "t", "atomic-fmin-fmax-global-f64")
TARGET_BUILTIN(__builtin_amdgcn_raw_ptr_buffer_atomic_fmin_f32, "ffQbiiIi", "", "atomic-fmin-fmax-global-f32")
TARGET_BUILTIN(__builtin_amdgcn_raw_ptr_buffer_atomic_fmax_f32, "ffQbiiIi", "", "atomic-fmin-fmax-global-f32")
TARGET_BUILTIN(__builtin_amdgcn_raw_ptr_buffer_atomic_fmin_f64, "ddQbiiIi", "", "atomic-fmin-fmax-global-f64")
TARGET_BUILTIN(__builtin_amdgcn_raw_ptr_buffer_atomic_fmax_f64, "ddQbiiIi", "", "atomic-fmin-fmax-global-f64")

TARGET_BUILTIN(__builtin_amdgcn_raw_ptr_buffer_load_lds, "vQbv*3IUiiiIiIi", "t", "vmem-to-lds-load-insts")
TARGET_BUILTIN(__builtin_amdgcn_struct_ptr_buffer_load_lds, "vQbv*3IUiiiiIiIi", "t", "vmem-to-lds-load-insts")
Expand Down
2 changes: 2 additions & 0 deletions clang/lib/AST/ByteCode/Compiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3948,6 +3948,8 @@ bool Compiler<Emitter>::VisitRecoveryExpr(const RecoveryExpr *E) {
template <class Emitter>
bool Compiler<Emitter>::VisitAddrLabelExpr(const AddrLabelExpr *E) {
assert(E->getType()->isVoidPointerType());
if (DiscardResult)
return true;

return this->emitDummyPtr(E, E);
}
Expand Down
2 changes: 2 additions & 0 deletions clang/lib/AST/ByteCode/Interp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -832,6 +832,8 @@ bool CheckLoad(InterpState &S, CodePtr OpPC, const Pointer &Ptr,
return false;
if (!CheckVolatile(S, OpPC, Ptr, AK))
return false;
if (!Ptr.isConst() && !S.inConstantContext() && isConstexprUnknown(Ptr))
return false;
return true;
}

Expand Down
5 changes: 4 additions & 1 deletion clang/lib/AST/ByteCode/InterpBuiltin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -749,7 +749,7 @@ static bool interp__builtin_overflowop(InterpState &S, CodePtr OpPC,
const CallExpr *Call,
unsigned BuiltinOp) {
const Pointer &ResultPtr = S.Stk.pop<Pointer>();
if (ResultPtr.isDummy())
if (ResultPtr.isDummy() || !ResultPtr.isBlockPointer())
return false;

PrimType RHST = *S.getContext().classify(Call->getArg(1)->getType());
Expand Down Expand Up @@ -1941,6 +1941,9 @@ static bool interp__builtin_memcmp(InterpState &S, CodePtr OpPC,
return true;
}

if (!PtrA.isBlockPointer() || !PtrB.isBlockPointer())
return false;

bool IsWide =
(ID == Builtin::BIwmemcmp || ID == Builtin::BI__builtin_wmemcmp);

Expand Down
34 changes: 33 additions & 1 deletion clang/lib/CodeGen/CGDebugInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,33 @@ static bool IsArtificial(VarDecl const *VD) {
cast<Decl>(VD->getDeclContext())->isImplicit());
}

/// Returns \c true if the specified variable \c VD is an explicit parameter of
/// a synthesized Objective-C property accessor. E.g., a synthesized property
/// setter method will have a single explicit parameter which is the property to
/// set.
static bool IsObjCSynthesizedPropertyExplicitParameter(VarDecl const *VD) {
assert(VD);

if (!llvm::isa<ParmVarDecl>(VD))
return false;

// Not a property method.
const auto *Method =
llvm::dyn_cast_or_null<ObjCMethodDecl>(VD->getDeclContext());
if (!Method)
return false;

// Not a synthesized property accessor.
if (!Method->isImplicit() || !Method->isPropertyAccessor())
return false;

// Not an explicit parameter.
if (VD->isImplicit())
return false;

return true;
}

CGDebugInfo::CGDebugInfo(CodeGenModule &CGM)
: CGM(CGM), DebugKind(CGM.getCodeGenOpts().getDebugInfo()),
DebugTypeExtRefs(CGM.getCodeGenOpts().DebugTypeExtRefs),
Expand Down Expand Up @@ -5226,7 +5253,12 @@ llvm::DILocalVariable *CGDebugInfo::EmitDeclare(const VarDecl *VD,
}
SmallVector<uint64_t, 13> Expr;
llvm::DINode::DIFlags Flags = llvm::DINode::FlagZero;
if (VarIsArtificial)

// While synthesized Objective-C property setters are "artificial" (i.e., they
// are not spelled out in source), we want to pretend they are just like a
// regular non-compiler generated method. Hence, don't mark explicitly passed
// parameters of such methods as artificial.
if (VarIsArtificial && !IsObjCSynthesizedPropertyExplicitParameter(VD))
Flags |= llvm::DINode::FlagArtificial;

auto Align = getDeclAlignIfRequired(VD, CGM.getContext());
Expand Down
7 changes: 7 additions & 0 deletions clang/test/AST/ByteCode/builtin-functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1510,6 +1510,8 @@ namespace Memcmp {
static_assert(f());
#endif

int unknown;
void foo(void) { unknown *= __builtin_memcmp(0, 0, 2); }
}

namespace Memchr {
Expand Down Expand Up @@ -1853,3 +1855,8 @@ namespace InitParam {
}

#endif

namespace SAddOverflowInt {
int a;
void foo(void) { a *= __builtin_sadd_overflow(1, 2, 0); }
}
15 changes: 15 additions & 0 deletions clang/test/AST/ByteCode/codegen-cxx20.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// RUN: %clang_cc1 -triple x86_64-linux -emit-llvm -o - %s -fcxx-exceptions | FileCheck %s
// RUN: %clang_cc1 -triple x86_64-linux -emit-llvm -o - %s -fcxx-exceptions -fexperimental-new-constant-interpreter | FileCheck %s


/// The read from a used to succeed, causing the entire if statement to vanish.
extern void e();
int somefunc() {
auto foo = [a = false]() mutable {
if (a)
e();
};
foo();
}

// CHECK: call void @_Z1ev()
9 changes: 9 additions & 0 deletions clang/test/AST/ByteCode/cxx11.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -370,3 +370,12 @@ namespace GH150709 {
static_assert((e2[0].*mp)() == 1, ""); // ref-error {{constant expression}}
static_assert((g.*mp)() == 1, ""); // ref-error {{constant expression}}
}

namespace DiscardedAddrLabel {
void foo(void) {
L:
*&&L; // both-error {{indirection not permitted}} \
// both-warning {{expression result unused}}
}
}

3 changes: 3 additions & 0 deletions clang/test/CodeGen/arm-target-features.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@
// RUN: %clang_cc1 -triple thumb-linux-gnueabi -target-cpu cortex-m52 -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-ARMV81M-CORTEX-M52-LINUX
// CHECK-ARMV81M-CORTEX-M52-LINUX: "target-features"="+armv8.1-m.main,+dsp,+fp-armv8d16,+fp-armv8d16sp,+fp16,+fp64,+fullfp16,+hwdiv,+lob,+mve,+mve.fp,+pacbti,+ras,+thumb-mode,+vfp2,+vfp2sp,+vfp3d16,+vfp3d16sp,+vfp4d16,+vfp4d16sp"

// RUN: %clang_cc1 -triple thumb-linux-gnueabi -target-cpu star-mc3 -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-ARMV81M-STAR-MC3-LINUX
// CHECK-ARMV81M-STAR-MC3-LINUX: "target-features"="+armv8.1-m.main,+dsp,+fp-armv8d16,+fp-armv8d16sp,+fp16,+fp64,+fullfp16,+hwdiv,+lob,+mve,+mve.fp,+pacbti,+ras,+thumb-mode,+vfp2,+vfp2sp,+vfp3d16,+vfp3d16sp,+vfp4d16,+vfp4d16sp"

// RUN: %clang_cc1 -triple thumbv9.3a-linux-gnueabihf -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-ARCH93
// CHECK-ARCH93: "target-features"="+armv9.3-a,+thumb-mode,+v8.1a,+v8.2a,+v8.3a,+v8.4a,+v8.5a,+v8.6a,+v8.7a,+v8.8a,+v9.1a,+v9.2a,+v9.3a,+v9a"

Expand Down
63 changes: 63 additions & 0 deletions clang/test/DebugInfo/ObjC/property-synthesized-accessors.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
// Test that synthesized accessors get treated like regular method declarations/definitions.
// I.e.:
// 1. explicitly passed parameter are not marked artificial.
// 2. Each property accessor has a method declaration and definition.

// RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm -dwarf-version=5 -debug-info-kind=limited %s -o - | FileCheck %s --implicit-check-not "DIFlagArtificial"

@interface Foo
@property int p1;
@end

@implementation Foo
@end

int main(void) {
Foo *f;
f.p1 = 2;
return f.p1;
}

// CHECK: ![[P1_TYPE:[0-9]+]] = !DIBasicType(name: "int"
// CHECK: ![[GETTER_DECL:[0-9]+]] = !DISubprogram(name: "-[Foo p1]"
// CHECK-SAME: type: ![[GETTER_TYPE:[0-9]+]]
// CHECK-SAME: flags: DIFlagArtificial | DIFlagPrototyped
// CHECK-SAME: spFlags: DISPFlagLocalToUnit)

// CHECK: ![[GETTER_TYPE]] = !DISubroutineType(types: ![[GETTER_PARAMS:[0-9]+]])
// CHECK: ![[GETTER_PARAMS]] = !{![[P1_TYPE]], ![[ID_TYPE:[0-9]+]], ![[SEL_TYPE:[0-9]+]]}
// CHECK: ![[ID_TYPE]] = !DIDerivedType(tag: DW_TAG_pointer_type
// CHECK-SAME: flags: DIFlagArtificial | DIFlagObjectPointer)
// CHECK: ![[SEL_TYPE]] = !DIDerivedType(tag: DW_TAG_typedef, name: "SEL"
// CHECK-SAME: flags: DIFlagArtificial)

// CHECK: ![[SETTER_DECL:[0-9]+]] = !DISubprogram(name: "-[Foo setP1:]"
// CHECK-SAME: type: ![[SETTER_TYPE:[0-9]+]]
// CHECK-SAME: flags: DIFlagArtificial | DIFlagPrototyped
// CHECK-SAME: spFlags: DISPFlagLocalToUnit)
// CHECK: ![[SETTER_TYPE]] = !DISubroutineType(types: ![[SETTER_PARAMS:[0-9]+]])
// CHECK: ![[SETTER_PARAMS]] = !{null, ![[ID_TYPE]], ![[SEL_TYPE]], ![[P1_TYPE]]}

// CHECK: ![[GETTER_DEF:[0-9]+]] = distinct !DISubprogram(name: "-[Foo p1]"
// CHECK-SAME: type: ![[GETTER_TYPE]]
// CHECK-SAME: flags: DIFlagArtificial | DIFlagPrototyped
// CHECK-SAME: spFlags: DISPFlagLocalToUnit | DISPFlagDefinition
// CHECK-SAME: declaration: ![[GETTER_DECL]]

// CHECK: !DILocalVariable(name: "self", arg: 1, scope: ![[GETTER_DEF]]
// CHECK-SAME: flags: DIFlagArtificial | DIFlagObjectPointer)
//
// CHECK: !DILocalVariable(name: "_cmd", arg: 2, scope: ![[GETTER_DEF]],
// CHECK-SAME: flags: DIFlagArtificial)

// CHECK: ![[SETTER_DEF:[0-9]+]] = distinct !DISubprogram(name: "-[Foo setP1:]",
// CHECK-SAME: type: ![[SETTER_TYPE]]
// CHECK-SAME: flags: DIFlagArtificial | DIFlagPrototyped
// CHECK-SAME: spFlags: DISPFlagLocalToUnit | DISPFlagDefinition
// CHECK-SAME: declaration: ![[SETTER_DECL]]

// CHECK: !DILocalVariable(name: "self", arg: 1, scope: ![[SETTER_DEF]]
// CHECK-SAME: flags: DIFlagArtificial | DIFlagObjectPointer
// CHECK: !DILocalVariable(name: "_cmd", arg: 2, scope: ![[SETTER_DEF]]
// CHECK-SAME: flags: DIFlagArtificial
// CHECK: !DILocalVariable(name: "p1", arg: 3, scope: ![[SETTER_DEF]]
3 changes: 3 additions & 0 deletions clang/test/Driver/arm-cortex-cpus-2.c
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,9 @@
// RUN: %clang -target arm -mcpu=cortex-m52 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CORTEX-M52 %s
// CHECK-CORTEX-M52: "-cc1"{{.*}} "-triple" "thumbv8.1m.main-{{.*}} "-target-cpu" "cortex-m52"

// RUN: %clang -target arm -mcpu=star-mc3 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-STAR-MC3 %s
// CHECK-STAR-MC3: "-cc1"{{.*}} "-triple" "thumbv8.1m.main-{{.*}} "-target-cpu" "star-mc3"

// RUN: %clang -target arm -mcpu=neoverse-n2 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-NEOVERSE-N2 %s
// CHECK-NEOVERSE-N2: "-cc1"{{.*}} "-triple" "armv9a-{{.*}}" "-target-cpu" "neoverse-n2"

Expand Down
1 change: 1 addition & 0 deletions clang/test/Misc/target-invalid-cpu-note/arm.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
// CHECK-SAME: {{^}}, cortex-m55
// CHECK-SAME: {{^}}, cortex-m85
// CHECK-SAME: {{^}}, cortex-m52
// CHECK-SAME: {{^}}, star-mc3
// CHECK-SAME: {{^}}, cortex-a32
// CHECK-SAME: {{^}}, cortex-a35
// CHECK-SAME: {{^}}, cortex-a53
Expand Down
18 changes: 18 additions & 0 deletions clang/test/SemaHIP/builtins-amdgcn-raw-buffer-atomic-add.hip
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// RUN: %clang_cc1 -fsyntax-only -triple amdgcn -target-cpu gfx90a -verify %s -fcuda-is-device
// RUN: %clang_cc1 -fsyntax-only -triple x86_64 -aux-triple amdgcn -verify %s

typedef _Float16 __attribute__((ext_vector_type(2))) float16x2_t;

#define __device__ __attribute__((device))

__device__ void test_raw_ptr_atomics(__amdgpu_buffer_rsrc_t rsrc, int i32, float f32, float16x2_t v2f16, int offset, int soffset) {
i32 = __builtin_amdgcn_raw_ptr_buffer_atomic_add_i32(i32, rsrc, offset, soffset, 0);
f32 = __builtin_amdgcn_raw_ptr_buffer_atomic_fadd_f32(f32, rsrc, offset, soffset, 0);
v2f16 = __builtin_amdgcn_raw_ptr_buffer_atomic_fadd_v2f16(v2f16, rsrc, offset, soffset, 0);
}

__device__ void test_raw_ptr_atomics_err(__amdgpu_buffer_rsrc_t rsrc, int i32, float f32, float16x2_t v2f16, int offset, int soffset) {
i32 = __builtin_amdgcn_raw_ptr_buffer_atomic_add_i32(i32, rsrc, offset, soffset, 0, 4); // expected-error{{too many arguments to function call}}
f32 = __builtin_amdgcn_raw_ptr_buffer_atomic_fadd_f32(f32, rsrc, offset, soffset, 0, 4); // expected-error{{too many arguments to function call}}
v2f16 = __builtin_amdgcn_raw_ptr_buffer_atomic_fadd_v2f16(v2f16, rsrc, offset, soffset, 0, 4);
}
18 changes: 18 additions & 0 deletions clang/test/SemaHIP/builtins-amdgcn-raw-buffer-atomic-fmin-max.hip
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// RUN: %clang_cc1 -fsyntax-only -triple amdgcn -target-cpu gfx90a -verify %s -fcuda-is-device
// RUN: %clang_cc1 -fsyntax-only -triple x86_64 -aux-triple amdgcn -verify %s

#define __device__ __attribute__((device))

__device__ void test_raw_ptr_atomics(__amdgpu_buffer_rsrc_t rsrc, float f32, double f64, int offset, int soffset) {
f32 = __builtin_amdgcn_raw_ptr_buffer_atomic_fmin_f32(f32, rsrc, offset, soffset, 0);
f64 = __builtin_amdgcn_raw_ptr_buffer_atomic_fmin_f64(f64, rsrc, offset, soffset, 0);
f32 = __builtin_amdgcn_raw_ptr_buffer_atomic_fmax_f32(f32, rsrc, offset, soffset, 0);
f64 = __builtin_amdgcn_raw_ptr_buffer_atomic_fmax_f64(f64, rsrc, offset, soffset, 0);
}

__device__ void test_raw_ptr_atomics_err(__amdgpu_buffer_rsrc_t rsrc, float f32, double f64, int offset, int soffset) {
f32 = __builtin_amdgcn_raw_ptr_buffer_atomic_fmin_f32(f32, rsrc, offset, soffset, 0, 4); // expected-error{{too many arguments to function call}}
f64 = __builtin_amdgcn_raw_ptr_buffer_atomic_fmin_f64(f64, rsrc, offset, soffset, 0, 4); // expected-error{{too many arguments to function call}}
f32 = __builtin_amdgcn_raw_ptr_buffer_atomic_fmax_f32(f32, rsrc, offset, soffset, 0, 4); // expected-error{{too many arguments to function call}}
f64 = __builtin_amdgcn_raw_ptr_buffer_atomic_fmax_f64(f64, rsrc, offset, soffset, 0, 4); // expected-error{{too many arguments to function call}}
}
17 changes: 16 additions & 1 deletion lldb/docs/use/tutorials/implementing-standalone-scripts.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,4 +131,19 @@ if target:
if symbol:
# We do have a symbol, print some info for the symbol
print(symbol)
```
```

### Expected Output

Exact output varies by system, but you should see something like this:

```
Creating a target for './a.out'
SBBreakpoint: id = 1, name = 'main', module = a.out, locations = 1
SBProcess: pid = 2593449, state = stopped, threads = 1, executable = a.out
thread #1: tid = 2593449, 0x0000aaaaaaaa0714 a.out`main at test.c:3:9, name = 'test.o', stop reason = breakpoint 1.1
frame #0: 0x0000aaaaaaaa0714 a.out`main at test.c:3:9
SBFunction: id = 0x0000002e, name = main, type = main
a.out[0x714]: mov w0, #0x0 ; =0
a.out[0x718]: ret
```
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@ class TestFrameVarDILGlobalVariableLookup(TestBase):
NO_DEBUG_INFO_TESTCASE = True

@skipIf(macos_version=["<", "15.0"], archs=["arm64", "arm64e"])
@expectedFailureAll(
dwarf_version=["<", "5"],
oslist=[lldbplatformutil.getDarwinOSTriples()],
)
@expectedFailureAll(
compiler="clang",
compiler_version=["<", "19.0"],
oslist=[lldbplatformutil.getDarwinOSTriples()],
)
def test_frame_var(self):
self.build()
lldbutil.run_to_source_breakpoint(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
OBJC_SOURCES := main.m
LDFLAGS := -lobjc

include Makefile.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
"""
Test debug-info parsing of synthesized Objective-C properties.
"""

import lldb
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil


class TestSynthesizedPropertyAccessor(TestBase):
def test(self):
self.build()

(target, _, _, _) = lldbutil.run_to_source_breakpoint(
self, "return f.fooProp", lldb.SBFileSpec("main.m")
)

getters = target.FindFunctions("-[Foo fooProp]", lldb.eFunctionNameTypeSelector)
self.assertEqual(len(getters), 1)
getter = getters[0].function.GetType()
self.assertTrue(getter)
self.assertEqual(getter.GetDisplayTypeName(), "int ()")

setters = target.FindFunctions(
"-[Foo setFooProp:]", lldb.eFunctionNameTypeSelector
)
self.assertEqual(len(setters), 1)
setter = setters[0].function.GetType()
self.assertTrue(setter)
self.assertEqual(setter.GetDisplayTypeName(), "void (int)")
14 changes: 14 additions & 0 deletions lldb/test/API/lang/objc/synthesized-property-accessor/main.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#import <Foundation/Foundation.h>

@interface Foo : NSObject
@property(readwrite) int fooProp;
@end

@implementation Foo
@end

int main() {
Foo *f = [Foo new];
[f setFooProp:10];
return f.fooProp;
}
Loading