From b41b743d461168300ae0121937b50e334563d307 Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Sat, 9 Jan 2021 23:56:55 -0800 Subject: [PATCH] [test] Improve weakref & weak_import tests --- clang/test/CodeGen/attr-weak-import.c | 8 ++++---- clang/test/CodeGen/attr-weakref.c | 7 +++---- clang/test/CodeGen/attr-weakref2.c | 4 ++-- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/clang/test/CodeGen/attr-weak-import.c b/clang/test/CodeGen/attr-weak-import.c index 23d02c1..85989f0 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 0923cf3..7ed4efd 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 47c96fd..2746819 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) { -- 2.7.4