[llvm-branch-commits] [clang] dec1bbb - Fix -allow-deprecated-dag-overlap in test/CodeGen/dso-local-executable.c
Fangrui Song via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Thu Dec 3 21:29:17 PST 2020
Author: Fangrui Song
Date: 2020-12-03T21:24:38-08:00
New Revision: dec1bbb47cda3098c1621f780f10cee3fd91e7b1
URL: https://github.com/llvm/llvm-project/commit/dec1bbb47cda3098c1621f780f10cee3fd91e7b1
DIFF: https://github.com/llvm/llvm-project/commit/dec1bbb47cda3098c1621f780f10cee3fd91e7b1.diff
LOG: Fix -allow-deprecated-dag-overlap in test/CodeGen/dso-local-executable.c
Added:
Modified:
clang/test/CodeGen/dso-local-executable.c
Removed:
################################################################################
diff --git a/clang/test/CodeGen/dso-local-executable.c b/clang/test/CodeGen/dso-local-executable.c
index 13e11158300f..3e1dcd209d04 100644
--- a/clang/test/CodeGen/dso-local-executable.c
+++ b/clang/test/CodeGen/dso-local-executable.c
@@ -1,93 +1,93 @@
-// RUN: %clang_cc1 -triple x86_64-pc-win32 -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix=COFF %s
-// COFF-DAG: @bar = external dso_local global i32
-// COFF-DAG: @weak_bar = extern_weak global i32
+// RUN: %clang_cc1 -triple x86_64-pc-win32 -emit-llvm %s -o - | FileCheck --check-prefix=COFF %s
+// COFF: @baz = dso_local global i32 42
+// COFF-NEXT: @import_var = external dllimport global i32
+// COFF-NEXT: @weak_bar = extern_weak global i32
+// COFF-NEXT: @bar = external dso_local global i32
+// COFF-NEXT: @local_thread_var = dso_local thread_local global i32 42
+// COFF-NEXT: @thread_var = external dso_local thread_local global i32
// COFF-DAG: declare dso_local void @foo()
-// COFF-DAG: @baz = dso_local global i32 42
// COFF-DAG: define dso_local i32* @zed()
-// COFF-DAG: @thread_var = external dso_local thread_local global i32
-// COFF-DAG: @local_thread_var = dso_local thread_local global i32 42
-// COFF-DAG: @import_var = external dllimport global i32
// COFF-DAG: declare dllimport void @import_func()
-// RUN: %clang_cc1 -triple x86_64-w64-mingw32 -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix=MINGW %s
-// MINGW-DAG: @bar = external global i32
-// MINGW-DAG: @weak_bar = extern_weak global i32
+// RUN: %clang_cc1 -triple x86_64-w64-mingw32 -emit-llvm %s -o - | FileCheck --check-prefix=MINGW %s
+// MINGW: @baz = dso_local global i32 42
+// MINGW-NEXT: @import_var = external dllimport global i32
+// MINGW-NEXT: @weak_bar = extern_weak global i32
+// MINGW-NEXT: @bar = external global i32
+// MINGW-NEXT: @local_thread_var = dso_local thread_local global i32 42
+// MINGW-NEXT: @thread_var = external dso_local thread_local global i32
// MINGW-DAG: declare dso_local void @foo()
-// MINGW-DAG: @baz = dso_local global i32 42
// MINGW-DAG: define dso_local i32* @zed()
-// MINGW-DAG: @thread_var = external dso_local thread_local global i32
-// MINGW-DAG: @local_thread_var = dso_local thread_local global i32 42
-// MINGW-DAG: @import_var = external dllimport global i32
// MINGW-DAG: declare dllimport void @import_func()
-// RUN: %clang_cc1 -triple x86_64-pc-linux -emit-llvm -mrelocation-model static %s -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix=STATIC %s
-// STATIC-DAG: @bar = external dso_local global i32
-// STATIC-DAG: @weak_bar = extern_weak dso_local global i32
+// RUN: %clang_cc1 -triple x86_64 -emit-llvm -mrelocation-model static %s -o - | FileCheck --check-prefix=STATIC %s
+// STATIC: @baz = dso_local global i32 42
+// STATIC-NEXT: @import_var = external dso_local global i32
+// STATIC-NEXT: @weak_bar = extern_weak dso_local global i32
+// STATIC-NEXT: @bar = external dso_local global i32
+// STATIC-NEXT: @local_thread_var = dso_local thread_local global i32 42
+// STATIC-NEXT: @thread_var = external thread_local global i32
// STATIC-DAG: declare dso_local void @foo()
-// STATIC-DAG: @baz = dso_local global i32 42
// STATIC-DAG: define dso_local i32* @zed()
-// STATIC-DAG: @thread_var = external thread_local global i32
-// STATIC-DAG: @local_thread_var = dso_local thread_local global i32 42
-// STATIC-DAG: @import_var = external dso_local global i32
// STATIC-DAG: declare dso_local void @import_func()
-// RUN: %clang_cc1 -triple x86_64-pc-linux -emit-llvm -pic-is-pie -mpie-copy-relocations %s -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix=PIE-COPY %s
-// PIE-COPY-DAG: @bar = external dso_local global i32
-// PIE-COPY-DAG: @weak_bar = extern_weak global i32
-// PIE-COPY-DAG: declare void @foo()
-// PIE-COPY-DAG: @baz = dso_local global i32 42
-// PIE-COPY-DAG: define dso_local i32* @zed()
-// PIE-COPY-DAG: @thread_var = external thread_local global i32
-// PIE-COPY-DAG: @local_thread_var = dso_local thread_local global i32 42
-// PIE-COPY-DAG: @import_var = external dso_local global i32
-// PIE-COPY-DAG: declare void @import_func()
-
-// RUN: %clang_cc1 -triple x86_64-pc-linux -emit-llvm -pic-is-pie %s -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix=PIE %s
-// PIE-DAG: @bar = external global i32
-// PIE-DAG: @weak_bar = extern_weak global i32
+// RUN: %clang_cc1 -triple x86_64 -emit-llvm -pic-level 1 -pic-is-pie %s -o - | FileCheck --check-prefix=PIE %s
+// PIE: @baz = dso_local global i32 42
+// PIE-NEXT: @import_var = external global i32
+// PIE-NEXT: @weak_bar = extern_weak global i32
+// PIE-NEXT: @bar = external global i32
+// PIE-NEXT: @local_thread_var = dso_local thread_local global i32 42
+// PIE-NEXT: @thread_var = external thread_local global i32
// PIE-DAG: declare void @foo()
-// PIE-DAG: @baz = dso_local global i32 42
// PIE-DAG: define dso_local i32* @zed()
-// PIE-DAG: @thread_var = external thread_local global i32
-// PIE-DAG: @local_thread_var = dso_local thread_local global i32 42
-// PIE-DAG: @import_var = external global i32
// PIE-DAG: declare void @import_func()
-// RUN: %clang_cc1 -triple x86_64-pc-linux -emit-llvm -mrelocation-model static -fno-plt %s -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix=NOPLT %s
-// NOPLT-DAG: @bar = external dso_local global i32
-// NOPLT-DAG: @weak_bar = extern_weak dso_local global i32
+// RUN: %clang_cc1 -triple x86_64 -emit-llvm -pic-level 1 -pic-is-pie -mpie-copy-relocations %s -o - | FileCheck --check-prefix=PIE-DIRECT %s
+// PIE-DIRECT: @baz = dso_local global i32 42
+// PIE-DIRECT-NEXT: @import_var = external dso_local global i32
+// PIE-DIRECT-NEXT: @weak_bar = extern_weak global i32
+// PIE-DIRECT-NEXT: @bar = external dso_local global i32
+// PIE-DIRECT-NEXT: @local_thread_var = dso_local thread_local global i32 42
+// PIE-DIRECT-NEXT: @thread_var = external thread_local global i32
+// PIE-DIRECT-DAG: declare void @foo()
+// PIE-DIRECT-DAG: define dso_local i32* @zed()
+// PIE-DIRECT-DAG: declare void @import_func()
+
+// RUN: %clang_cc1 -triple x86_64 -emit-llvm -mrelocation-model static -fno-plt %s -o - | FileCheck --check-prefix=NOPLT %s
+// NOPLT: @baz = dso_local global i32 42
+// NOPLT-NEXT: @import_var = external dso_local global i32
+// NOPLT-NEXT: @weak_bar = extern_weak dso_local global i32
+// NOPLT-NEXT: @bar = external dso_local global i32
+// NOPLT-NEXT: @local_thread_var = dso_local thread_local global i32 42
+// NOPLT-NEXT: @thread_var = external thread_local global i32
// NOPLT-DAG: declare void @foo()
-// NOPLT-DAG: @baz = dso_local global i32 42
// NOPLT-DAG: define dso_local i32* @zed()
-// NOPLT-DAG: @thread_var = external thread_local global i32
-// NOPLT-DAG: @local_thread_var = dso_local thread_local global i32 42
-// NOPLT-DAG: @import_var = external dso_local global i32
// NOPLT-DAG: declare void @import_func()
-// RUN: %clang_cc1 -triple x86_64-pc-linux -emit-llvm -fno-plt -pic-is-pie -mpie-copy-relocations %s -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix=PIE-COPY-NOPLT %s
-// PIE-COPY-NOPLT-DAG: @bar = external dso_local global i32
-// PIE-COPY-NOPLT-DAG: @weak_bar = extern_weak global i32
-// PIE-COPY-NOPLT-DAG: declare void @foo()
-// PIE-COPY-NOPLT-DAG: @baz = dso_local global i32 42
-// PIE-COPY-NOPLT-DAG: define dso_local i32* @zed()
-// PIE-COPY-NOPLT-DAG: @thread_var = external thread_local global i32
-// PIE-COPY-NOPLT-DAG: @local_thread_var = dso_local thread_local global i32 42
-// PIE-COPY-NOPLT-DAG: @import_var = external dso_local global i32
-// PIE-COPY-NOPLT-DAG: declare void @import_func()
+// RUN: %clang_cc1 -triple x86_64 -emit-llvm -fno-plt -pic-level 1 -pic-is-pie -mpie-copy-relocations %s -o - | FileCheck --check-prefix=PIE-DIRECT-NOPLT %s
+// PIE-DIRECT-NOPLT: @baz = dso_local global i32 42
+// PIE-DIRECT-NOPLT-NEXT: @import_var = external dso_local global i32
+// PIE-DIRECT-NOPLT-NEXT: @weak_bar = extern_weak global i32
+// PIE-DIRECT-NOPLT-NEXT: @bar = external dso_local global i32
+// PIE-DIRECT-NOPLT-NEXT: @local_thread_var = dso_local thread_local global i32 42
+// PIE-DIRECT-NOPLT-NEXT: @thread_var = external thread_local global i32
+// PIE-DIRECT-NOPLT-DAG: declare void @foo()
+// PIE-DIRECT-NOPLT-DAG: define dso_local i32* @zed()
+// PIE-DIRECT-NOPLT-DAG: declare void @import_func()
-// RUN: %clang_cc1 -triple x86_64-pc-linux -emit-llvm -pic-is-pie -fno-plt %s -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix=PIE-NO-PLT %s
-// RUN: %clang_cc1 -triple powerpc64le-pc-linux -emit-llvm -mrelocation-model static %s -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix=PIE-NO-PLT %s
-// PIE-NO-PLT-DAG: @bar = external global i32
-// PIE-NO-PLT-DAG: @weak_bar = extern_weak global i32
-// PIE-NO-PLT-DAG: declare void @foo()
-// PIE-NO-PLT-DAG: @baz = dso_local global i32 42
-// PIE-NO-PLT-DAG: define dso_local i32* @zed()
-// PIE-NO-PLT-DAG: @thread_var = external thread_local global i32
-// PIE-NO-PLT-DAG: @local_thread_var = dso_local thread_local global i32 42
-// PIE-NO-PLT-DAG: @import_var = external global i32
-// PIE-NO-PLT-DAG: declare void @import_func()
+// RUN: %clang_cc1 -triple x86_64 -emit-llvm -pic-is-pie -fno-plt %s -o - | FileCheck --check-prefix=PIE-NO-PLT %s
+// RUN: %clang_cc1 -triple powerpc64le -emit-llvm -mrelocation-model static %s -o - | FileCheck --check-prefix=PIE-NO-PLT %s
+// PIE-NO-PLT: @baz = dso_local global i32 42
+// PIE-NO-PLT-NEXT: @import_var = external global i32
+// PIE-NO-PLT-NEXT: @weak_bar = extern_weak global i32
+// PIE-NO-PLT-NEXT: @bar = external global i32
+// PIE-NO-PLT-NEXT: @local_thread_var = dso_local thread_local global i32 42
+// PIE-NO-PLT-NEXT: @thread_var = external thread_local global i32
+// PIE-NO-PLT-DAG: declare void @import_func()
+// PIE-NO-PLT-DAG: define dso_local i32* @zed()
+// PIE-NO-PLT-DAG: declare void @foo()
-// RUN: %clang_cc1 -triple x86_64-pc-linux -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix=SHARED %s
+// RUN: %clang_cc1 -triple x86_64 -emit-llvm -pic-level 2 %s -o - | FileCheck --check-prefix=SHARED %s
// SHARED-DAG: @bar = external global i32
// SHARED-DAG: @weak_bar = extern_weak global i32
// SHARED-DAG: declare void @foo()
@@ -95,10 +95,11 @@
// SHARED-DAG: define i32* @zed()
// SHARED-DAG: @thread_var = external thread_local global i32
// SHARED-DAG: @local_thread_var = thread_local global i32 42
-// PIE-NO-PLT-DAG: @import_var = external global i32
-// PIE-NO-PLT-DAG: declare void @import_func()
+int baz = 42;
__attribute__((dllimport)) extern int import_var;
+__attribute__((weak)) extern int weak_bar;
+extern int bar;
__attribute__((dllimport)) void import_func(void);
int *use_import() {
@@ -106,18 +107,15 @@ int *use_import() {
return &import_var;
}
-extern int bar;
-__attribute__((weak)) extern int weak_bar;
void foo(void);
-int baz = 42;
int *zed() {
foo();
return baz ? &weak_bar : &bar;
}
-extern __thread int thread_var;
__thread int local_thread_var = 42;
+extern __thread int thread_var;
int *get_thread_var(int a) {
return a ? &thread_var : &local_thread_var;
}
More information about the llvm-branch-commits
mailing list