diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2018-02-23 15:32:32 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2018-02-23 15:32:32 +0000 |
commit | db74826fe1c25fbce7e3132e44fe9dff3eafcf3a (patch) | |
tree | eaaef64596df2d36109bd1fb80d4709c0bb8f818 /test/CodeGen/dllimport.c | |
parent | dddfaa1e7a54a28fffa56f08456a1fa0ad642ea6 (diff) | |
download | clang-db74826fe1c25fbce7e3132e44fe9dff3eafcf3a.tar.gz |
Start setting dso_local for COFF.
With this there are still some GVs where we don't set dso_local
because setGVProperties is never called. I intend to fix that in
followup commits. This is just the bare minimum to teach
shouldAssumeDSOLocal what it should do for COFF.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@325915 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/dllimport.c')
-rw-r--r-- | test/CodeGen/dllimport.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/test/CodeGen/dllimport.c b/test/CodeGen/dllimport.c index f70048ebd1..61d6957052 100644 --- a/test/CodeGen/dllimport.c +++ b/test/CodeGen/dllimport.c @@ -39,14 +39,14 @@ USEVAR(GlobalRedecl2) // NB: MSVC issues a warning and makes GlobalRedecl3 dllexport. We follow GCC // and drop the dllimport with a warning. -// CHECK: @GlobalRedecl3 = external global i32 +// CHECK: @GlobalRedecl3 = external dso_local global i32 __declspec(dllimport) extern int GlobalRedecl3; extern int GlobalRedecl3; // dllimport ignored USEVAR(GlobalRedecl3) // Make sure this works even if the decl has been used before it's defined (PR20792). -// MS: @GlobalRedecl4 = common dllexport global i32 -// GNU: @GlobalRedecl4 = common global i32 +// MS: @GlobalRedecl4 = common dso_local dllexport global i32 +// GNU: @GlobalRedecl4 = common dso_local global i32 __declspec(dllimport) extern int GlobalRedecl4; USEVAR(GlobalRedecl4) int GlobalRedecl4; // dllimport ignored @@ -76,22 +76,22 @@ int functionScope() { __declspec(dllimport) void decl(void); // Initialize use_decl with the address of the thunk. -// CHECK-DAG: @use_decl = global void ()* @decl +// CHECK-DAG: @use_decl = dso_local global void ()* @decl void (*use_decl)(void) = &decl; // Import inline function. // MS-DAG: declare dllimport void @inlineFunc() // MO1-DAG: define available_externally dllimport void @inlineFunc() -// GNU-DAG: declare void @inlineFunc() -// GO1-DAG: define available_externally void @inlineFunc() +// GNU-DAG: declare dso_local void @inlineFunc() +// GO1-DAG: define available_externally dso_local void @inlineFunc() __declspec(dllimport) inline void inlineFunc(void) {} USE(inlineFunc) // inline attributes // MS-DAG: declare dllimport void @noinline() // MO1-DAG: define available_externally dllimport void @noinline() -// GNU-DAG: declare void @noinline() -// GO1-DAG: define available_externally void @noinline() +// GNU-DAG: declare dso_local void @noinline() +// GO1-DAG: define available_externally dso_local void @noinline() // CHECK-NOT: @alwaysInline() // O1-NOT: @alwaysInline() __declspec(dllimport) __attribute__((noinline)) inline void noinline(void) {} @@ -107,20 +107,20 @@ USE(redecl1) // NB: MSVC issues a warning and makes redecl2/redecl3 dllexport. We follow GCC // and drop the dllimport with a warning. -// CHECK-DAG: declare void @redecl2() +// CHECK-DAG: declare dso_local void @redecl2() __declspec(dllimport) void redecl2(void); void redecl2(void); USE(redecl2) -// MS: define dllexport void @redecl3() -// GNU: define void @redecl3() +// MS: define dso_local dllexport void @redecl3() +// GNU: define dso_local void @redecl3() __declspec(dllimport) void redecl3(void); void redecl3(void) {} // dllimport ignored USE(redecl3) // Make sure this works even if the decl is used before it's defined (PR20792). -// MS: define dllexport void @redecl4() -// GNU: define void @redecl4() +// MS: define dso_local dllexport void @redecl4() +// GNU: define dso_local void @redecl4() __declspec(dllimport) void redecl4(void); USE(redecl4) void redecl4(void) {} // dllimport ignored |