https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/179673
None >From f7ca45ebd24e7325fe3f4991bef9c95709b19533 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= <[email protected]> Date: Wed, 4 Feb 2026 15:33:31 +0100 Subject: [PATCH] [clang][bytecode] Visit 2nd atomic_is_lock_free arg as lvalue --- clang/lib/AST/ByteCode/Compiler.cpp | 9 +++++++++ clang/test/Sema/sizeless-1.c | 4 ++++ 2 files changed, 13 insertions(+) diff --git a/clang/lib/AST/ByteCode/Compiler.cpp b/clang/lib/AST/ByteCode/Compiler.cpp index af076f90733df..122f2d7ee47af 100644 --- a/clang/lib/AST/ByteCode/Compiler.cpp +++ b/clang/lib/AST/ByteCode/Compiler.cpp @@ -5164,6 +5164,15 @@ bool Compiler<Emitter>::VisitBuiltinCallExpr(const CallExpr *E, case Builtin::BI__builtin_assume: // Argument is not evaluated. break; + case Builtin::BI__atomic_is_lock_free: + case Builtin::BI__atomic_always_lock_free: { + assert(E->getNumArgs() == 2); + if (!this->visit(E->getArg(0))) + return false; + if (!this->visitAsLValue(E->getArg(1))) + return false; + } break; + default: if (!Context::isUnevaluatedBuiltin(BuiltinID)) { // Put arguments on the stack. diff --git a/clang/test/Sema/sizeless-1.c b/clang/test/Sema/sizeless-1.c index b6b92e7a68c19..7c8eed994a6a1 100644 --- a/clang/test/Sema/sizeless-1.c +++ b/clang/test/Sema/sizeless-1.c @@ -2,6 +2,10 @@ // RUN: %clang_cc1 -fsyntax-only -verify -Wall -W -Wno-strict-prototypes -triple arm64-linux-gnu -target-feature +sve -std=c11 %s // RUN: %clang_cc1 -fsyntax-only -verify -Wall -W -Wno-strict-prototypes -triple arm64-linux-gnu -target-feature +sve -std=gnu11 %s +// RUN: %clang_cc1 -fsyntax-only -verify -Wall -W -Wno-comment -Wno-strict-prototypes -triple arm64-linux-gnu -target-feature +sve -std=c90 %s -fexperimental-new-constant-interpreter +// RUN: %clang_cc1 -fsyntax-only -verify -Wall -W -Wno-strict-prototypes -triple arm64-linux-gnu -target-feature +sve -std=c11 %s -fexperimental-new-constant-interpreter +// RUN: %clang_cc1 -fsyntax-only -verify -Wall -W -Wno-strict-prototypes -triple arm64-linux-gnu -target-feature +sve -std=gnu11 %s -fexperimental-new-constant-interpreter + typedef __SVInt8_t svint8_t; typedef __SVInt16_t svint16_t; _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
