Skip to content

Commit 9633084

Browse files
SC llvm teamSC llvm team
authored andcommitted
Merged main:55d4816393f897054a4721920502d45c645edf1d into amd-gfx:f95c9bf0b616
Local branch amd-gfx f95c9bf Merged main:8bed754c2f965c8cbbb050be6f650b78f7fd78a6 into amd-gfx:9711fab8fdda Remote branch main 55d4816 [NFC] Remove trailing white spaces
2 parents f95c9bf + 55d4816 commit 9633084

File tree

77 files changed

+1436
-687
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+1436
-687
lines changed

clang/cmake/caches/Fuchsia.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ set(_FUCHSIA_BOOTSTRAP_PASSTHROUGH
6666
LLDB_PYTHON_HOME
6767
LLDB_PYTHON_RELATIVE_PATH
6868
LLDB_TEST_USE_VENDOR_PACKAGES
69+
LLDB_TEST_USER_ARGS
6970
Python3_EXECUTABLE
7071
Python3_LIBRARIES
7172
Python3_INCLUDE_DIRS
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
//===--- Builtins.def - Builtin function info database ----------*- C++ -*-===//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
9+
// This is only documentation for the database layout. This will be removed once
10+
// all builtin databases are converted to tablegen files
11+
12+
// The second value provided to the macro specifies the type of the function
13+
// (result value, then each argument) as follows:
14+
// v -> void
15+
// b -> boolean
16+
// c -> char
17+
// s -> short
18+
// i -> int
19+
// h -> half (__fp16, OpenCL)
20+
// x -> half (_Float16)
21+
// y -> half (__bf16)
22+
// f -> float
23+
// d -> double
24+
// z -> size_t
25+
// w -> wchar_t
26+
// F -> constant CFString
27+
// G -> id
28+
// H -> SEL
29+
// M -> struct objc_super
30+
// a -> __builtin_va_list
31+
// A -> "reference" to __builtin_va_list
32+
// V -> Vector, followed by the number of elements and the base type.
33+
// q -> Scalable vector, followed by the number of elements and the base type.
34+
// Q -> target builtin type, followed by a character to distinguish the builtin type
35+
// Qa -> AArch64 svcount_t builtin type.
36+
// E -> ext_vector, followed by the number of elements and the base type.
37+
// X -> _Complex, followed by the base type.
38+
// Y -> ptrdiff_t
39+
// P -> FILE
40+
// J -> jmp_buf
41+
// SJ -> sigjmp_buf
42+
// K -> ucontext_t
43+
// p -> pid_t
44+
// . -> "...". This may only occur at the end of the function list.
45+
//
46+
// Types may be prefixed with the following modifiers:
47+
// L -> long (e.g. Li for 'long int', Ld for 'long double')
48+
// LL -> long long (e.g. LLi for 'long long int', LLd for __float128)
49+
// LLL -> __int128_t (e.g. LLLi)
50+
// Z -> int32_t (require a native 32-bit integer type on the target)
51+
// W -> int64_t (require a native 64-bit integer type on the target)
52+
// N -> 'int' size if target is LP64, 'L' otherwise.
53+
// O -> long for OpenCL targets, long long otherwise.
54+
// S -> signed
55+
// U -> unsigned
56+
// I -> Required to constant fold to an integer constant expression.
57+
//
58+
// Types may be postfixed with the following modifiers:
59+
// * -> pointer (optionally followed by an address space number, if no address
60+
// space is specified than any address space will be accepted)
61+
// & -> reference (optionally followed by an address space number)
62+
// C -> const
63+
// D -> volatile
64+
// R -> restrict
65+
66+
// The third value provided to the macro specifies information about attributes
67+
// of the function. These must be kept in sync with the predicates in the
68+
// Builtin::Context class. Currently we have:
69+
// n -> nothrow
70+
// r -> noreturn
71+
// U -> pure
72+
// c -> const
73+
// t -> signature is meaningless, use custom typechecking
74+
// T -> type is not important to semantic analysis and codegen; recognize as
75+
// builtin even if type doesn't match signature, and don't warn if we
76+
// can't be sure the type is right
77+
// F -> this is a libc/libm function with a '__builtin_' prefix added.
78+
// f -> this is a libc/libm function without a '__builtin_' prefix, or with
79+
// 'z', a C++ standard library function in namespace std::. This builtin
80+
// is disableable by '-fno-builtin-foo' / '-fno-builtin-std-foo'.
81+
// h -> this function requires a specific header or an explicit declaration.
82+
// i -> this is a runtime library implemented function without the
83+
// '__builtin_' prefix. It will be implemented in compiler-rt or libgcc.
84+
// p:N: -> this is a printf-like function whose Nth argument is the format
85+
// string.
86+
// P:N: -> similar to the p:N: attribute, but the function is like vprintf
87+
// in that it accepts its arguments as a va_list rather than
88+
// through an ellipsis
89+
// s:N: -> this is a scanf-like function whose Nth argument is the format
90+
// string.
91+
// S:N: -> similar to the s:N: attribute, but the function is like vscanf
92+
// in that it accepts its arguments as a va_list rather than
93+
// through an ellipsis
94+
// e -> const, but only when -fno-math-errno and FP exceptions are ignored
95+
// g -> const when FP exceptions are ignored
96+
// j -> returns_twice (like setjmp)
97+
// u -> arguments are not evaluated for their side-effects
98+
// V:N: -> requires vectors of at least N bits to be legal
99+
// C<N,M_0,...,M_k> -> callback behavior: argument N is called with argument
100+
// M_0, ..., M_k as payload
101+
// z -> this is a function in (possibly-versioned) namespace std
102+
// E -> this function can be constant evaluated by Clang frontend

clang/include/clang/Basic/CodeGenOptions.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ CODEGENOPT(UniqueBasicBlockSectionNames, 1, 1) ///< Set for -funique-basic-block
5959
///< basic block sections.
6060
CODEGENOPT(EnableAIXExtendedAltivecABI, 1, 0) ///< Set for -mabi=vec-extabi. Enables the extended Altivec ABI on AIX.
6161
CODEGENOPT(XCOFFReadOnlyPointers, 1, 0) ///< Set for -mxcoff-roptr.
62+
CODEGENOPT(AllTocData, 1, 0) ///< AIX -mtocdata
6263
ENUM_CODEGENOPT(FramePointer, FramePointerKind, 2, FramePointerKind::None) /// frame-pointer: all,non-leaf,none
6364

6465
CODEGENOPT(ClearASTBeforeBackend , 1, 0) ///< Free the AST before running backend code generation. Only works with -disable-free.

clang/include/clang/Basic/CodeGenOptions.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -410,9 +410,6 @@ class CodeGenOptions : public CodeGenOptionsBase {
410410
/// List of global variables that over-ride the toc-data default.
411411
std::vector<std::string> NoTocDataVars;
412412

413-
/// Flag for all global variables to be treated as toc-data.
414-
bool AllTocData;
415-
416413
/// Path to allowlist file specifying which objects
417414
/// (files, functions) should exclusively be instrumented
418415
/// by sanitizer coverage pass.

clang/test/Headers/__clang_hip_math.hip

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1687,7 +1687,7 @@ extern "C" __device__ double test_j1(double x) {
16871687
// DEFAULT-NEXT: [[__X1_0_I3:%.*]] = phi float [ [[SUB_I:%.*]], [[FOR_BODY_I]] ], [ [[CALL_I21_I]], [[IF_END4_I]] ]
16881688
// DEFAULT-NEXT: [[__X0_0_I2:%.*]] = phi float [ [[__X1_0_I3]], [[FOR_BODY_I]] ], [ [[CALL_I_I]], [[IF_END4_I]] ]
16891689
// DEFAULT-NEXT: [[MUL_I:%.*]] = shl nuw nsw i32 [[__I_0_I4]], 1
1690-
// DEFAULT-NEXT: [[CONV_I:%.*]] = sitofp i32 [[MUL_I]] to float
1690+
// DEFAULT-NEXT: [[CONV_I:%.*]] = uitofp i32 [[MUL_I]] to float
16911691
// DEFAULT-NEXT: [[DIV_I:%.*]] = fdiv contract float [[CONV_I]], [[Y]]
16921692
// DEFAULT-NEXT: [[MUL8_I:%.*]] = fmul contract float [[__X1_0_I3]], [[DIV_I]]
16931693
// DEFAULT-NEXT: [[SUB_I]] = fsub contract float [[MUL8_I]], [[__X0_0_I2]]
@@ -1720,7 +1720,7 @@ extern "C" __device__ double test_j1(double x) {
17201720
// FINITEONLY-NEXT: [[__X1_0_I3:%.*]] = phi float [ [[SUB_I:%.*]], [[FOR_BODY_I]] ], [ [[CALL_I21_I]], [[IF_END4_I]] ]
17211721
// FINITEONLY-NEXT: [[__X0_0_I2:%.*]] = phi float [ [[__X1_0_I3]], [[FOR_BODY_I]] ], [ [[CALL_I_I]], [[IF_END4_I]] ]
17221722
// FINITEONLY-NEXT: [[MUL_I:%.*]] = shl nuw nsw i32 [[__I_0_I4]], 1
1723-
// FINITEONLY-NEXT: [[CONV_I:%.*]] = sitofp i32 [[MUL_I]] to float
1723+
// FINITEONLY-NEXT: [[CONV_I:%.*]] = uitofp i32 [[MUL_I]] to float
17241724
// FINITEONLY-NEXT: [[DIV_I:%.*]] = fdiv nnan ninf contract float [[CONV_I]], [[Y]]
17251725
// FINITEONLY-NEXT: [[MUL8_I:%.*]] = fmul nnan ninf contract float [[__X1_0_I3]], [[DIV_I]]
17261726
// FINITEONLY-NEXT: [[SUB_I]] = fsub nnan ninf contract float [[MUL8_I]], [[__X0_0_I2]]
@@ -1753,7 +1753,7 @@ extern "C" __device__ double test_j1(double x) {
17531753
// APPROX-NEXT: [[__X1_0_I3:%.*]] = phi float [ [[SUB_I:%.*]], [[FOR_BODY_I]] ], [ [[CALL_I21_I]], [[IF_END4_I]] ]
17541754
// APPROX-NEXT: [[__X0_0_I2:%.*]] = phi float [ [[__X1_0_I3]], [[FOR_BODY_I]] ], [ [[CALL_I_I]], [[IF_END4_I]] ]
17551755
// APPROX-NEXT: [[MUL_I:%.*]] = shl nuw nsw i32 [[__I_0_I4]], 1
1756-
// APPROX-NEXT: [[CONV_I:%.*]] = sitofp i32 [[MUL_I]] to float
1756+
// APPROX-NEXT: [[CONV_I:%.*]] = uitofp i32 [[MUL_I]] to float
17571757
// APPROX-NEXT: [[DIV_I:%.*]] = fdiv contract float [[CONV_I]], [[Y]]
17581758
// APPROX-NEXT: [[MUL8_I:%.*]] = fmul contract float [[__X1_0_I3]], [[DIV_I]]
17591759
// APPROX-NEXT: [[SUB_I]] = fsub contract float [[MUL8_I]], [[__X0_0_I2]]
@@ -1790,7 +1790,7 @@ extern "C" __device__ float test_jnf(int x, float y) {
17901790
// DEFAULT-NEXT: [[__X1_0_I3:%.*]] = phi double [ [[SUB_I:%.*]], [[FOR_BODY_I]] ], [ [[CALL_I21_I]], [[IF_END4_I]] ]
17911791
// DEFAULT-NEXT: [[__X0_0_I2:%.*]] = phi double [ [[__X1_0_I3]], [[FOR_BODY_I]] ], [ [[CALL_I_I]], [[IF_END4_I]] ]
17921792
// DEFAULT-NEXT: [[MUL_I:%.*]] = shl nuw nsw i32 [[__I_0_I4]], 1
1793-
// DEFAULT-NEXT: [[CONV_I:%.*]] = sitofp i32 [[MUL_I]] to double
1793+
// DEFAULT-NEXT: [[CONV_I:%.*]] = uitofp i32 [[MUL_I]] to double
17941794
// DEFAULT-NEXT: [[DIV_I:%.*]] = fdiv contract double [[CONV_I]], [[Y]]
17951795
// DEFAULT-NEXT: [[MUL8_I:%.*]] = fmul contract double [[__X1_0_I3]], [[DIV_I]]
17961796
// DEFAULT-NEXT: [[SUB_I]] = fsub contract double [[MUL8_I]], [[__X0_0_I2]]
@@ -1823,7 +1823,7 @@ extern "C" __device__ float test_jnf(int x, float y) {
18231823
// FINITEONLY-NEXT: [[__X1_0_I3:%.*]] = phi double [ [[SUB_I:%.*]], [[FOR_BODY_I]] ], [ [[CALL_I21_I]], [[IF_END4_I]] ]
18241824
// FINITEONLY-NEXT: [[__X0_0_I2:%.*]] = phi double [ [[__X1_0_I3]], [[FOR_BODY_I]] ], [ [[CALL_I_I]], [[IF_END4_I]] ]
18251825
// FINITEONLY-NEXT: [[MUL_I:%.*]] = shl nuw nsw i32 [[__I_0_I4]], 1
1826-
// FINITEONLY-NEXT: [[CONV_I:%.*]] = sitofp i32 [[MUL_I]] to double
1826+
// FINITEONLY-NEXT: [[CONV_I:%.*]] = uitofp i32 [[MUL_I]] to double
18271827
// FINITEONLY-NEXT: [[DIV_I:%.*]] = fdiv nnan ninf contract double [[CONV_I]], [[Y]]
18281828
// FINITEONLY-NEXT: [[MUL8_I:%.*]] = fmul nnan ninf contract double [[__X1_0_I3]], [[DIV_I]]
18291829
// FINITEONLY-NEXT: [[SUB_I]] = fsub nnan ninf contract double [[MUL8_I]], [[__X0_0_I2]]
@@ -1856,7 +1856,7 @@ extern "C" __device__ float test_jnf(int x, float y) {
18561856
// APPROX-NEXT: [[__X1_0_I3:%.*]] = phi double [ [[SUB_I:%.*]], [[FOR_BODY_I]] ], [ [[CALL_I21_I]], [[IF_END4_I]] ]
18571857
// APPROX-NEXT: [[__X0_0_I2:%.*]] = phi double [ [[__X1_0_I3]], [[FOR_BODY_I]] ], [ [[CALL_I_I]], [[IF_END4_I]] ]
18581858
// APPROX-NEXT: [[MUL_I:%.*]] = shl nuw nsw i32 [[__I_0_I4]], 1
1859-
// APPROX-NEXT: [[CONV_I:%.*]] = sitofp i32 [[MUL_I]] to double
1859+
// APPROX-NEXT: [[CONV_I:%.*]] = uitofp i32 [[MUL_I]] to double
18601860
// APPROX-NEXT: [[DIV_I:%.*]] = fdiv contract double [[CONV_I]], [[Y]]
18611861
// APPROX-NEXT: [[MUL8_I:%.*]] = fmul contract double [[__X1_0_I3]], [[DIV_I]]
18621862
// APPROX-NEXT: [[SUB_I]] = fsub contract double [[MUL8_I]], [[__X0_0_I2]]
@@ -4224,7 +4224,7 @@ extern "C" __device__ double test_y1(double x) {
42244224
// DEFAULT-NEXT: [[__X1_0_I3:%.*]] = phi float [ [[SUB_I:%.*]], [[FOR_BODY_I]] ], [ [[CALL_I21_I]], [[IF_END4_I]] ]
42254225
// DEFAULT-NEXT: [[__X0_0_I2:%.*]] = phi float [ [[__X1_0_I3]], [[FOR_BODY_I]] ], [ [[CALL_I_I]], [[IF_END4_I]] ]
42264226
// DEFAULT-NEXT: [[MUL_I:%.*]] = shl nuw nsw i32 [[__I_0_I4]], 1
4227-
// DEFAULT-NEXT: [[CONV_I:%.*]] = sitofp i32 [[MUL_I]] to float
4227+
// DEFAULT-NEXT: [[CONV_I:%.*]] = uitofp i32 [[MUL_I]] to float
42284228
// DEFAULT-NEXT: [[DIV_I:%.*]] = fdiv contract float [[CONV_I]], [[Y]]
42294229
// DEFAULT-NEXT: [[MUL8_I:%.*]] = fmul contract float [[__X1_0_I3]], [[DIV_I]]
42304230
// DEFAULT-NEXT: [[SUB_I]] = fsub contract float [[MUL8_I]], [[__X0_0_I2]]
@@ -4257,7 +4257,7 @@ extern "C" __device__ double test_y1(double x) {
42574257
// FINITEONLY-NEXT: [[__X1_0_I3:%.*]] = phi float [ [[SUB_I:%.*]], [[FOR_BODY_I]] ], [ [[CALL_I21_I]], [[IF_END4_I]] ]
42584258
// FINITEONLY-NEXT: [[__X0_0_I2:%.*]] = phi float [ [[__X1_0_I3]], [[FOR_BODY_I]] ], [ [[CALL_I_I]], [[IF_END4_I]] ]
42594259
// FINITEONLY-NEXT: [[MUL_I:%.*]] = shl nuw nsw i32 [[__I_0_I4]], 1
4260-
// FINITEONLY-NEXT: [[CONV_I:%.*]] = sitofp i32 [[MUL_I]] to float
4260+
// FINITEONLY-NEXT: [[CONV_I:%.*]] = uitofp i32 [[MUL_I]] to float
42614261
// FINITEONLY-NEXT: [[DIV_I:%.*]] = fdiv nnan ninf contract float [[CONV_I]], [[Y]]
42624262
// FINITEONLY-NEXT: [[MUL8_I:%.*]] = fmul nnan ninf contract float [[__X1_0_I3]], [[DIV_I]]
42634263
// FINITEONLY-NEXT: [[SUB_I]] = fsub nnan ninf contract float [[MUL8_I]], [[__X0_0_I2]]
@@ -4290,7 +4290,7 @@ extern "C" __device__ double test_y1(double x) {
42904290
// APPROX-NEXT: [[__X1_0_I3:%.*]] = phi float [ [[SUB_I:%.*]], [[FOR_BODY_I]] ], [ [[CALL_I21_I]], [[IF_END4_I]] ]
42914291
// APPROX-NEXT: [[__X0_0_I2:%.*]] = phi float [ [[__X1_0_I3]], [[FOR_BODY_I]] ], [ [[CALL_I_I]], [[IF_END4_I]] ]
42924292
// APPROX-NEXT: [[MUL_I:%.*]] = shl nuw nsw i32 [[__I_0_I4]], 1
4293-
// APPROX-NEXT: [[CONV_I:%.*]] = sitofp i32 [[MUL_I]] to float
4293+
// APPROX-NEXT: [[CONV_I:%.*]] = uitofp i32 [[MUL_I]] to float
42944294
// APPROX-NEXT: [[DIV_I:%.*]] = fdiv contract float [[CONV_I]], [[Y]]
42954295
// APPROX-NEXT: [[MUL8_I:%.*]] = fmul contract float [[__X1_0_I3]], [[DIV_I]]
42964296
// APPROX-NEXT: [[SUB_I]] = fsub contract float [[MUL8_I]], [[__X0_0_I2]]
@@ -4327,7 +4327,7 @@ extern "C" __device__ float test_ynf(int x, float y) {
43274327
// DEFAULT-NEXT: [[__X1_0_I3:%.*]] = phi double [ [[SUB_I:%.*]], [[FOR_BODY_I]] ], [ [[CALL_I21_I]], [[IF_END4_I]] ]
43284328
// DEFAULT-NEXT: [[__X0_0_I2:%.*]] = phi double [ [[__X1_0_I3]], [[FOR_BODY_I]] ], [ [[CALL_I_I]], [[IF_END4_I]] ]
43294329
// DEFAULT-NEXT: [[MUL_I:%.*]] = shl nuw nsw i32 [[__I_0_I4]], 1
4330-
// DEFAULT-NEXT: [[CONV_I:%.*]] = sitofp i32 [[MUL_I]] to double
4330+
// DEFAULT-NEXT: [[CONV_I:%.*]] = uitofp i32 [[MUL_I]] to double
43314331
// DEFAULT-NEXT: [[DIV_I:%.*]] = fdiv contract double [[CONV_I]], [[Y]]
43324332
// DEFAULT-NEXT: [[MUL8_I:%.*]] = fmul contract double [[__X1_0_I3]], [[DIV_I]]
43334333
// DEFAULT-NEXT: [[SUB_I]] = fsub contract double [[MUL8_I]], [[__X0_0_I2]]
@@ -4360,7 +4360,7 @@ extern "C" __device__ float test_ynf(int x, float y) {
43604360
// FINITEONLY-NEXT: [[__X1_0_I3:%.*]] = phi double [ [[SUB_I:%.*]], [[FOR_BODY_I]] ], [ [[CALL_I21_I]], [[IF_END4_I]] ]
43614361
// FINITEONLY-NEXT: [[__X0_0_I2:%.*]] = phi double [ [[__X1_0_I3]], [[FOR_BODY_I]] ], [ [[CALL_I_I]], [[IF_END4_I]] ]
43624362
// FINITEONLY-NEXT: [[MUL_I:%.*]] = shl nuw nsw i32 [[__I_0_I4]], 1
4363-
// FINITEONLY-NEXT: [[CONV_I:%.*]] = sitofp i32 [[MUL_I]] to double
4363+
// FINITEONLY-NEXT: [[CONV_I:%.*]] = uitofp i32 [[MUL_I]] to double
43644364
// FINITEONLY-NEXT: [[DIV_I:%.*]] = fdiv nnan ninf contract double [[CONV_I]], [[Y]]
43654365
// FINITEONLY-NEXT: [[MUL8_I:%.*]] = fmul nnan ninf contract double [[__X1_0_I3]], [[DIV_I]]
43664366
// FINITEONLY-NEXT: [[SUB_I]] = fsub nnan ninf contract double [[MUL8_I]], [[__X0_0_I2]]
@@ -4393,7 +4393,7 @@ extern "C" __device__ float test_ynf(int x, float y) {
43934393
// APPROX-NEXT: [[__X1_0_I3:%.*]] = phi double [ [[SUB_I:%.*]], [[FOR_BODY_I]] ], [ [[CALL_I21_I]], [[IF_END4_I]] ]
43944394
// APPROX-NEXT: [[__X0_0_I2:%.*]] = phi double [ [[__X1_0_I3]], [[FOR_BODY_I]] ], [ [[CALL_I_I]], [[IF_END4_I]] ]
43954395
// APPROX-NEXT: [[MUL_I:%.*]] = shl nuw nsw i32 [[__I_0_I4]], 1
4396-
// APPROX-NEXT: [[CONV_I:%.*]] = sitofp i32 [[MUL_I]] to double
4396+
// APPROX-NEXT: [[CONV_I:%.*]] = uitofp i32 [[MUL_I]] to double
43974397
// APPROX-NEXT: [[DIV_I:%.*]] = fdiv contract double [[CONV_I]], [[Y]]
43984398
// APPROX-NEXT: [[MUL8_I:%.*]] = fmul contract double [[__X1_0_I3]], [[DIV_I]]
43994399
// APPROX-NEXT: [[SUB_I]] = fsub contract double [[MUL8_I]], [[__X0_0_I2]]

clang/test/Preprocessor/riscv-target-features.c

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,14 @@
5656
// CHECK-NOT: __riscv_xcvmac {{.*$}}
5757
// CHECK-NOT: __riscv_xcvmem {{.*$}}
5858
// CHECK-NOT: __riscv_xcvsimd {{.*$}}
59+
// CHECK-NOT: __riscv_xsfcease {{.*$}}
5960
// CHECK-NOT: __riscv_xsfvcp {{.*$}}
6061
// CHECK-NOT: __riscv_xsfvfnrclipxfqf {{.*$}}
6162
// CHECK-NOT: __riscv_xsfvfwmaccqqq {{.*$}}
6263
// CHECK-NOT: __riscv_xsfqmaccdod {{.*$}}
6364
// CHECK-NOT: __riscv_xsfvqmaccqoq {{.*$}}
65+
// CHECK-NOT: __riscv_xsifivecdiscarddlone {{.*$}}
66+
// CHECK-NOT: __riscv_xsifivecflushdlone {{.*$}}
6467
// CHECK-NOT: __riscv_xtheadba {{.*$}}
6568
// CHECK-NOT: __riscv_xtheadbb {{.*$}}
6669
// CHECK-NOT: __riscv_xtheadbs {{.*$}}
@@ -517,6 +520,14 @@
517520
// RUN: -o - | FileCheck --check-prefix=CHECK-XCVSIMD-EXT %s
518521
// CHECK-XCVSIMD-EXT: __riscv_xcvsimd 1000000{{$}}
519522

523+
// RUN: %clang --target=riscv32-unknown-linux-gnu \
524+
// RUN: -march=rv32ixsfcease -E -dM %s \
525+
// RUN: -o - | FileCheck --check-prefix=CHECK-XSFCEASE-EXT %s
526+
// RUN: %clang --target=riscv64-unknown-linux-gnu \
527+
// RUN: -march=rv64ixsfcease -E -dM %s \
528+
// RUN: -o - | FileCheck --check-prefix=CHECK-XSFCEASE-EXT %s
529+
// CHECK-XSFCEASE-EXT: __riscv_xsfcease 1000000{{$}}
530+
520531
// RUN: %clang --target=riscv32-unknown-linux-gnu \
521532
// RUN: -march=rv32ixsfvcp -E -dM %s \
522533
// RUN: -o - | FileCheck --check-prefix=CHECK-XSFVCP-EXT %s
@@ -557,6 +568,22 @@
557568
// RUN: -o - | FileCheck --check-prefix=CHECK-XSFVQMACCQOQ-EXT %s
558569
// CHECK-XSFVQMACCQOQ-EXT: __riscv_xsfvqmaccqoq 1000000{{$}}
559570

571+
// RUN: %clang --target=riscv32-unknown-linux-gnu \
572+
// RUN: -march=rv32ixsifivecdiscarddlone -E -dM %s \
573+
// RUN: -o - | FileCheck --check-prefix=CHECK-XSIFIVECDISCARDDLONE-EXT %s
574+
// RUN: %clang --target=riscv64-unknown-linux-gnu \
575+
// RUN: -march=rv64ixsifivecdiscarddlone -E -dM %s \
576+
// RUN: -o - | FileCheck --check-prefix=CHECK-XSIFIVECDISCARDDLONE-EXT %s
577+
// CHECK-XSIFIVECDISCARDDLONE-EXT: __riscv_xsifivecdiscarddlone 1000000{{$}}
578+
579+
// RUN: %clang --target=riscv32-unknown-linux-gnu \
580+
// RUN: -march=rv32ixsifivecflushdlone -E -dM %s \
581+
// RUN: -o - | FileCheck --check-prefix=CHECK-XSIFIVECFLUSHDLONE-EXT %s
582+
// RUN: %clang --target=riscv64-unknown-linux-gnu \
583+
// RUN: -march=rv64ixsifivecflushdlone -E -dM %s \
584+
// RUN: -o - | FileCheck --check-prefix=CHECK-XSIFIVECFLUSHDLONE-EXT %s
585+
// CHECK-XSIFIVECFLUSHDLONE-EXT: __riscv_xsifivecflushdlone 1000000{{$}}
586+
560587
// RUN: %clang --target=riscv32-unknown-linux-gnu \
561588
// RUN: -march=rv32ixtheadba -E -dM %s \
562589
// RUN: -o - | FileCheck --check-prefix=CHECK-XTHEADBA-EXT %s

compiler-rt/lib/asan/asan_interceptors.cpp

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -570,6 +570,17 @@ INTERCEPTOR(char *, strcpy, char *to, const char *from) {
570570
return REAL(strcpy)(to, from);
571571
}
572572

573+
// Windows doesn't always define the strdup identifier,
574+
// and when it does it's a macro defined to either _strdup
575+
// or _strdup_dbg, _strdup_dbg ends up calling _strdup, so
576+
// we want to intercept that. push/pop_macro are used to avoid problems
577+
// if this file ends up including <string.h> in the future.
578+
# if SANITIZER_WINDOWS
579+
# pragma push_macro("strdup")
580+
# undef strdup
581+
# define strdup _strdup
582+
# endif
583+
573584
INTERCEPTOR(char*, strdup, const char *s) {
574585
void *ctx;
575586
ASAN_INTERCEPTOR_ENTER(ctx, strdup);
@@ -587,7 +598,7 @@ INTERCEPTOR(char*, strdup, const char *s) {
587598
return reinterpret_cast<char*>(new_mem);
588599
}
589600

590-
#if ASAN_INTERCEPT___STRDUP
601+
# if ASAN_INTERCEPT___STRDUP
591602
INTERCEPTOR(char*, __strdup, const char *s) {
592603
void *ctx;
593604
ASAN_INTERCEPTOR_ENTER(ctx, strdup);
@@ -770,7 +781,7 @@ void InitializeAsanInterceptors() {
770781
ASAN_INTERCEPT_FUNC(strncat);
771782
ASAN_INTERCEPT_FUNC(strncpy);
772783
ASAN_INTERCEPT_FUNC(strdup);
773-
#if ASAN_INTERCEPT___STRDUP
784+
# if ASAN_INTERCEPT___STRDUP
774785
ASAN_INTERCEPT_FUNC(__strdup);
775786
#endif
776787
#if ASAN_INTERCEPT_INDEX && ASAN_USE_ALIAS_ATTRIBUTE_FOR_INDEX
@@ -866,6 +877,10 @@ void InitializeAsanInterceptors() {
866877
VReport(1, "AddressSanitizer: libc interceptors initialized\n");
867878
}
868879

880+
# if SANITIZER_WINDOWS
881+
# pragma pop_macro("strdup")
882+
# endif
883+
869884
} // namespace __asan
870885

871886
#endif // !SANITIZER_FUCHSIA

compiler-rt/lib/asan/asan_win_dll_thunk.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ INTERCEPT_LIBRARY_FUNCTION(strchr);
8080
INTERCEPT_LIBRARY_FUNCTION(strcmp);
8181
INTERCEPT_LIBRARY_FUNCTION(strcpy);
8282
INTERCEPT_LIBRARY_FUNCTION(strcspn);
83-
INTERCEPT_LIBRARY_FUNCTION(strdup);
83+
INTERCEPT_LIBRARY_FUNCTION(_strdup);
8484
INTERCEPT_LIBRARY_FUNCTION(strlen);
8585
INTERCEPT_LIBRARY_FUNCTION(strncat);
8686
INTERCEPT_LIBRARY_FUNCTION(strncmp);

compiler-rt/lib/scudo/standalone/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ endif()
5858
set(SCUDO_HEADERS
5959
allocator_common.h
6060
allocator_config.h
61+
allocator_config_wrapper.h
6162
atomic_helpers.h
6263
bytemap.h
6364
checksum.h

0 commit comments

Comments
 (0)