Skip to content

Commit c37b420

Browse files
[test-suite] Fix custom section test on MachO Platforms
Fix the tests added in https://reviews.llvm.org/D154673 to work on apple platforms. Reviewed By: daltenty Differential Revision: https://reviews.llvm.org/D156462
1 parent bbe12ad commit c37b420

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

SingleSource/Regression/C++/custom_section_members.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
// Test that we can compile a simple class with members in a custom section.
2+
#if defined(__APPLE__)
3+
#define SECTNAME "__TEXT,__section"
4+
#else
5+
#define SECTNAME "section"
6+
#endif
27

38
struct A {
4-
static int foo() __attribute__((section("section")));
5-
static void bar() __attribute__((section("section")));
9+
static int foo() __attribute__((section(SECTNAME)));
10+
static void bar() __attribute__((section(SECTNAME)));
611
};
712

813
int A::foo() { return 0; }

0 commit comments

Comments
 (0)