[test] Improve weakref & weak_import tests
authorFangrui Song <i@maskray.me>
Sun, 10 Jan 2021 07:56:55 +0000 (23:56 -0800)
committerFangrui Song <i@maskray.me>
Sun, 10 Jan 2021 07:56:55 +0000 (23:56 -0800)
clang/test/CodeGen/attr-weak-import.c
clang/test/CodeGen/attr-weakref.c
clang/test/CodeGen/attr-weakref2.c

index 23d02c1..85989f0 100644 (file)
@@ -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
 
index 0923cf3..7ed4efd 100644 (file)
@@ -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) {
index 47c96fd..2746819 100644 (file)
@@ -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) {