Skip to content

Commit 2fbcf18

Browse files
committed
Add header guards to test/Interop
1 parent 6c9ccbc commit 2fbcf18

File tree

9 files changed

+45
-0
lines changed

9 files changed

+45
-0
lines changed

test/Interop/C/function/Inputs/emit-called-inline-function.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
#ifndef TEST_INTEROP_C_FUNCTION_INPUTS_EMIT_CALLED_INLINE_FUNCTION_H
2+
#define TEST_INTEROP_C_FUNCTION_INPUTS_EMIT_CALLED_INLINE_FUNCTION_H
3+
14
#ifdef __cplusplus
25
#define INLINE inline
36
#else
@@ -47,3 +50,5 @@ INLINE int calledFromSwift() {
4750
return calledTransitively();
4851
#endif
4952
}
53+
54+
#endif
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1+
#ifndef TEST_INTEROP_CXX_CLASS_INPUTS_MEMBER_VARIABLES_H
2+
#define TEST_INTEROP_CXX_CLASS_INPUTS_MEMBER_VARIABLES_H
3+
14
class MyClass {
25
public:
36
const int const_member = 23;
47
};
8+
9+
#endif

test/Interop/Cxx/class/Inputs/memory-layout.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
#ifndef TEST_INTEROP_CXX_CLASS_INPUTS_MEMORY_LAYOUT_H
2+
#define TEST_INTEROP_CXX_CLASS_INPUTS_MEMORY_LAYOUT_H
3+
14
#include <stddef.h>
25
#include <stdint.h>
36

@@ -15,3 +18,5 @@ inline size_t sizeOfPrivateMemberLayout() {
1518
inline size_t offsetOfPrivateMemberLayout_b() {
1619
return offsetof(PrivateMemberLayout, b);
1720
}
21+
22+
#endif

test/Interop/Cxx/extern-var/Inputs/extern-var.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
#ifndef TEST_INTEROP_CXX_EXTERN_VAR_INPUTS_EXTERN_VAR_H
2+
#define TEST_INTEROP_CXX_EXTERN_VAR_INPUTS_EXTERN_VAR_H
3+
14
extern int counter;
25

36
int getCounterFromCxx();
@@ -9,3 +12,5 @@ extern int counter;
912
int getCounterFromCxx();
1013
void setCounterFromCxx(int);
1114
} // namespace Namespaced
15+
16+
#endif

test/Interop/Cxx/static/Inputs/inline-static-member-var.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
#ifndef TEST_INTEROP_CXX_STATIC_INPUTS_INLINE_STATIC_MEMBER_VAR_H
2+
#define TEST_INTEROP_CXX_STATIC_INPUTS_INLINE_STATIC_MEMBER_VAR_H
3+
14
inline static int init() { return 42; }
25

36
class WithInlineStaticMember {
@@ -10,3 +13,5 @@ class WithInlineStaticMember {
1013
static int *getStaticMemberAddress();
1114
static void setStaticMemberFromCxx(int);
1215
};
16+
17+
#endif
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1+
#ifndef TEST_INTEROP_CXX_STATIC_INPUTS_STATIC_LOCAL_VAR_H
2+
#define TEST_INTEROP_CXX_STATIC_INPUTS_STATIC_LOCAL_VAR_H
3+
14
int counterWrapper();
25

36
inline int counter() {
47
static int a = 0;
58
return a++;
69
}
10+
11+
#endif
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1+
#ifndef TEST_INTEROP_CXX_STATIC_INPUTS_STATIC_MEMBER_FUNC_H
2+
#define TEST_INTEROP_CXX_STATIC_INPUTS_STATIC_MEMBER_FUNC_H
3+
14
class WithStaticMemberFunc {
25
public:
36
static int staticMemberFunc();
47
typedef int (*Func)();
58
static Func getStaticMemberFuncAddress();
69
};
10+
11+
#endif

test/Interop/Cxx/static/Inputs/static-member-var.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
#ifndef TEST_INTEROP_CXX_STATIC_INPUTS_STATIC_MEMBER_VAR_H
2+
#define TEST_INTEROP_CXX_STATIC_INPUTS_STATIC_MEMBER_VAR_H
3+
14
class WithStaticMember {
25
public:
36
static int staticMember;
@@ -37,3 +40,5 @@ class ClassB {
3740
public:
3841
static int notUniqueName;
3942
};
43+
44+
#endif

test/Interop/Cxx/static/Inputs/static-var.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
#ifndef TEST_INTEROP_CXX_STATIC_INPUTS_STATIC_VAR_H
2+
#define TEST_INTEROP_CXX_STATIC_INPUTS_STATIC_VAR_H
3+
14
static int staticVar = 2;
25
inline void setStaticVarFromCxx(int newVal) { staticVar = newVal; }
36
inline int getStaticVarFromCxx() { return staticVar; }
@@ -39,3 +42,5 @@ inline const NonTrivial *getstaticConstNonTrivialFromCxx() {
3942
}
4043

4144
static constexpr NonTrivial staticConstexprNonTrivial = NonTrivial(4096, 4096);
45+
46+
#endif

0 commit comments

Comments
 (0)