Skip to content

Commit e614050

Browse files
authored
[clang] Fix -fclang-abi-compat for clang 20 (#144109)
The value was known already, but it was parsed as latest which is incorrect because we are already doing clang 21.
1 parent 4e0dd00 commit e614050

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

clang/lib/Frontend/CompilerInvocation.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4475,6 +4475,8 @@ bool CompilerInvocation::ParseLangArgs(LangOptions &Opts, ArgList &Args,
44754475
Opts.setClangABICompat(LangOptions::ClangABI::Ver18);
44764476
else if (Major <= 19)
44774477
Opts.setClangABICompat(LangOptions::ClangABI::Ver19);
4478+
else if (Major <= 20)
4479+
Opts.setClangABICompat(LangOptions::ClangABI::Ver20);
44784480
} else if (Ver != "latest") {
44794481
Diags.Report(diag::err_drv_invalid_value)
44804482
<< A->getAsString(Args) << A->getValue();

clang/test/CodeGen/X86/avx-cxx-record.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// RUN: %clang_cc1 %s -triple x86_64-unknown-linux-gnu -emit-llvm -O2 -target-cpu x86-64-v3 -o - | FileCheck %s
2+
// RUN: %clang_cc1 %s -triple x86_64-unknown-linux-gnu -emit-llvm -O2 -target-cpu x86-64-v3 -fclang-abi-compat=20 -o - | FileCheck --check-prefix CLANG-20 %s
23

34
using UInt64x2 = unsigned long long __attribute__((__vector_size__(16), may_alias));
45

@@ -11,6 +12,7 @@ struct XMM2 : XMM1<0>, XMM1<1> {
1112
};
1213

1314
// CHECK: define{{.*}} @_Z3foov({{.*}} [[ARG:%.*]]){{.*}}
15+
// CLANG-20: define{{.*}} <4 x double> @_Z3foov()
1416
// CHECK: entry:
1517
// CHECK-NEXT: store {{.*}}, ptr [[ARG]]{{.*}}
1618
// CHECK-NEXT: [[TMP1:%.*]] = getelementptr {{.*}}, ptr [[ARG]]{{.*}}

0 commit comments

Comments
 (0)