Author: Fangrui Song Date: 2021-01-09T23:56:55-08:00 New Revision: b41b743d461168300ae0121937b50e334563d307
URL: https://github.com/llvm/llvm-project/commit/b41b743d461168300ae0121937b50e334563d307 DIFF: https://github.com/llvm/llvm-project/commit/b41b743d461168300ae0121937b50e334563d307.diff LOG: [test] Improve weakref & weak_import tests Added: Modified: clang/test/CodeGen/attr-weak-import.c clang/test/CodeGen/attr-weakref.c clang/test/CodeGen/attr-weakref2.c Removed: ################################################################################ diff --git a/clang/test/CodeGen/attr-weak-import.c b/clang/test/CodeGen/attr-weak-import.c index 23d02c10dca1..85989f03a277 100644 --- a/clang/test/CodeGen/attr-weak-import.c +++ b/clang/test/CodeGen/attr-weak-import.c @@ -18,9 +18,9 @@ extern int E __attribute__((weak_import)); int E; extern int E __attribute__((weak_import)); -// CHECK: @A ={{.*}} global i32 +// CHECK: @A = dso_local global i32 // CHECK-NOT: @B = -// CHECK: @C ={{.*}} global i32 -// CHECK: @D ={{.*}} global i32 -// CHECK: @E ={{.*}} global i32 +// CHECK: @C = dso_local global i32 +// CHECK: @D = dso_local global i32 +// CHECK: @E = dso_local global i32 diff --git a/clang/test/CodeGen/attr-weakref.c b/clang/test/CodeGen/attr-weakref.c index 0923cf33a6de..7ed4efdd2cb4 100644 --- a/clang/test/CodeGen/attr-weakref.c +++ b/clang/test/CodeGen/attr-weakref.c @@ -1,5 +1,4 @@ -// RUN: %clang_cc1 -emit-llvm -triple i386-linux-gnu -o %t %s -// RUN: FileCheck --input-file=%t %s +// RUN: %clang_cc1 -emit-llvm -triple i386-linux-gnu -o - %s | FileCheck %s // CHECK: declare extern_weak void @test1_f() void test1_f(void); @@ -8,7 +7,7 @@ void test1_h(void) { test1_g(); } -// CHECK-LABEL: define{{.*}} void @test2_f() +// CHECK-LABEL: define dso_local void @test2_f() void test2_f(void) {} static void test2_g(void) __attribute__((weakref("test2_f"))); void test2_h(void) { @@ -25,7 +24,7 @@ void test3_h(void) { test3_g(); } -// CHECK-LABEL: define{{.*}} void @test4_f() +// CHECK-LABEL: define dso_local void @test4_f() void test4_f(void); static void test4_g(void) __attribute__((weakref("test4_f"))); void test4_h(void) { diff --git a/clang/test/CodeGen/attr-weakref2.c b/clang/test/CodeGen/attr-weakref2.c index 47c96fd5af41..2746819833b1 100644 --- a/clang/test/CodeGen/attr-weakref2.c +++ b/clang/test/CodeGen/attr-weakref2.c @@ -8,7 +8,7 @@ int test1_h(void) { return test1_g; } -// CHECK: @test2_f ={{.*}} global i32 0, align 4 +// CHECK: @test2_f = dso_local global i32 0, align 4 int test2_f; static int test2_g __attribute__((weakref("test2_f"))); int test2_h(void) { @@ -25,7 +25,7 @@ int test3_h(void) { return test3_g; } -// CHECK: @test4_f ={{.*}} global i32 0, align 4 +// CHECK: @test4_f = dso_local global i32 0, align 4 extern int test4_f; static int test4_g __attribute__((weakref("test4_f"))); int test4_h(void) { _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits