Skip to content

Commit 15b1eb6

Browse files
committed
Add a test for class members in a custom section
Since there were some problems with the result of these cases, leading to invalid assembly/object code on some platforms. Fixed by https://reviews.llvm.org/D147184. Differential Revision: https://reviews.llvm.org/D154673
1 parent 9a550fb commit 15b1eb6

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Test that we can compile a simple class with members in a custom section.
2+
3+
struct A {
4+
static int foo() __attribute__((section("section")));
5+
static void bar() __attribute__((section("section")));
6+
};
7+
8+
int A::foo() { return 0; }
9+
void A::bar() {}
10+
11+
int main() {
12+
A::bar();
13+
return A::foo();
14+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
exit 0

0 commit comments

Comments
 (0)