diff --git a/bolt/test/reorder-data-writable-ptload.c b/bolt/test/reorder-data-writable-ptload.c index 7b384e9655a3283..fa9918779463a7e 100644 --- a/bolt/test/reorder-data-writable-ptload.c +++ b/bolt/test/reorder-data-writable-ptload.c @@ -1,7 +1,9 @@ // This test checks that reorder-data pass puts new hot .data section // to the writable segment. -// RUN: %clang %cflags -O3 -nostdlib -Wl,-q %s -o %t.exe +// Use -fPIC -pie to prevent the globals being put in .sdata instead of .data on +// RISC-V. +// RUN: %clang %cflags -fPIC -pie -O3 -nostdlib -Wl,-q %s -o %t.exe // RUN: llvm-bolt %t.exe -o %t.bolt --reorder-data=".data" \ // RUN: -data %S/Inputs/reorder-data-writable-ptload.fdata // RUN: llvm-readelf -SlW %t.bolt | FileCheck %s