[clang] 8cdb1aa - [Clang] Convert PCH tests to opaque pointers (NFC)

Nikita Popov via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 12 07:20:58 PST 2022


Author: Nikita Popov
Date: 2022-12-12T16:20:49+01:00
New Revision: 8cdb1aa1ec2ba15f5ec8641f5ece23758bf15a06

URL: https://github.com/llvm/llvm-project/commit/8cdb1aa1ec2ba15f5ec8641f5ece23758bf15a06
DIFF: https://github.com/llvm/llvm-project/commit/8cdb1aa1ec2ba15f5ec8641f5ece23758bf15a06.diff

LOG: [Clang] Convert PCH tests to opaque pointers (NFC)

Added: 
    

Modified: 
    clang/test/PCH/block-helpers.cpp
    clang/test/PCH/builtin-is-constant-evaluated.cpp
    clang/test/PCH/chain-openmp-threadprivate.cpp
    clang/test/PCH/chain-pending-instantiations.cpp
    clang/test/PCH/dllexport-default-arg-closure.cpp
    clang/test/PCH/pr27445.cpp
    clang/test/PCH/pragma-weak-functional.c

Removed: 
    


################################################################################
diff  --git a/clang/test/PCH/block-helpers.cpp b/clang/test/PCH/block-helpers.cpp
index 33bd5fad5aa0b..b66abf71b73e5 100644
--- a/clang/test/PCH/block-helpers.cpp
+++ b/clang/test/PCH/block-helpers.cpp
@@ -1,23 +1,20 @@
-// RUN: %clang_cc1 -no-opaque-pointers -x c++-header -triple x86_64-apple-darwin11 -emit-pch -fblocks -fexceptions -o %t %S/block-helpers.h
-// RUN: %clang_cc1 -no-opaque-pointers -triple x86_64-apple-darwin11 -include-pch %t -emit-llvm -fblocks -fexceptions -o - %s | FileCheck %s
+// RUN: %clang_cc1 -x c++-header -triple x86_64-apple-darwin11 -emit-pch -fblocks -fexceptions -o %t %S/block-helpers.h
+// RUN: %clang_cc1 -triple x86_64-apple-darwin11 -include-pch %t -emit-llvm -fblocks -fexceptions -o - %s | FileCheck %s
 
-// CHECK: %[[STRUCT_BLOCK_BYREF_X:.*]] = type { i8*, %[[STRUCT_BLOCK_BYREF_X]]*, i32, i32, i8*, i8*, %[[STRUCT_S0:.*]] }
+// CHECK: %[[STRUCT_BLOCK_BYREF_X:.*]] = type { ptr, ptr, i32, i32, ptr, ptr, %[[STRUCT_S0:.*]] }
 // CHECK: %[[STRUCT_S0]] = type { i32 }
-// CHECK: %[[STRUCT_BLOCK_BYREF_Y:.*]] = type { i8*, %[[STRUCT_BLOCK_BYREF_Y]]*, i32, i32, i8*, i8*, %[[STRUCT_S0]] }
-// CHECK: %[[STRUCT_BLOCK_DESCRIPTOR:.*]] = type { i64, i64 }
+// CHECK: %[[STRUCT_BLOCK_BYREF_Y:.*]] = type { ptr, ptr, i32, i32, ptr, ptr, %[[STRUCT_S0]] }
 
 // Check that byref structs are allocated for x and y.
 
 // CHECK-LABEL: define linkonce_odr void @_ZN1S1mEv(
 // CHECK: %[[X:.*]] = alloca %[[STRUCT_BLOCK_BYREF_X]], align 8
 // CHECK: %[[Y:.*]] = alloca %[[STRUCT_BLOCK_BYREF_Y]], align 8
-// CHECK: %[[BLOCK:.*]] = alloca <{ i8*, i32, i32, i8*, %[[STRUCT_BLOCK_DESCRIPTOR]]*, i8*, i8* }>, align 8
-// CHECK: %[[BLOCK_CAPTURED:.*]] = getelementptr inbounds <{ i8*, i32, i32, i8*, %[[STRUCT_BLOCK_DESCRIPTOR]]*, i8*, i8* }>, <{ i8*, i32, i32, i8*, %[[STRUCT_BLOCK_DESCRIPTOR]]*, i8*, i8* }>* %[[BLOCK]], i32 0, i32 5
-// CHECK: %[[V0:.*]] = bitcast %[[STRUCT_BLOCK_BYREF_X]]* %[[X]] to i8*
-// CHECK: store i8* %[[V0]], i8** %[[BLOCK_CAPTURED]], align 8
-// CHECK: %[[BLOCK_CAPTURED10:.*]] = getelementptr inbounds <{ i8*, i32, i32, i8*, %[[STRUCT_BLOCK_DESCRIPTOR]]*, i8*, i8* }>, <{ i8*, i32, i32, i8*, %[[STRUCT_BLOCK_DESCRIPTOR]]*, i8*, i8* }>* %[[BLOCK]], i32 0, i32 6
-// CHECK: %[[V1:.*]] = bitcast %[[STRUCT_BLOCK_BYREF_Y]]* %[[Y]] to i8*
-// CHECK: store i8* %[[V1]], i8** %[[BLOCK_CAPTURED10]], align 8
+// CHECK: %[[BLOCK:.*]] = alloca <{ ptr, i32, i32, ptr, ptr, ptr, ptr }>, align 8
+// CHECK: %[[BLOCK_CAPTURED:.*]] = getelementptr inbounds <{ ptr, i32, i32, ptr, ptr, ptr, ptr }>, ptr %[[BLOCK]], i32 0, i32 5
+// CHECK: store ptr %[[X]], ptr %[[BLOCK_CAPTURED]], align 8
+// CHECK: %[[BLOCK_CAPTURED10:.*]] = getelementptr inbounds <{ ptr, i32, i32, ptr, ptr, ptr, ptr }>, ptr %[[BLOCK]], i32 0, i32 6
+// CHECK: store ptr %[[Y]], ptr %[[BLOCK_CAPTURED10]], align 8
 
 // CHECK-LABEL: define internal void @___ZN1S1mEv_block_invoke(
 

diff  --git a/clang/test/PCH/builtin-is-constant-evaluated.cpp b/clang/test/PCH/builtin-is-constant-evaluated.cpp
index 558676fc78bf2..a74f493415a35 100644
--- a/clang/test/PCH/builtin-is-constant-evaluated.cpp
+++ b/clang/test/PCH/builtin-is-constant-evaluated.cpp
@@ -1,14 +1,14 @@
-// RUN: %clang_cc1 -no-opaque-pointers -std=c++98 -Wno-constant-evaluated -triple x86_64-linux -include %s -verify %s -emit-llvm -o - | FileCheck %s
-// RUN: %clang_cc1 -no-opaque-pointers -std=c++98 -Wno-constant-evaluated -triple x86_64-linux -emit-pch %s -o %t
-// RUN: %clang_cc1 -no-opaque-pointers -std=c++98 -Wno-constant-evaluated -triple x86_64-linux -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 -std=c++98 -Wno-constant-evaluated -triple x86_64-linux -include %s -verify %s -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 -std=c++98 -Wno-constant-evaluated -triple x86_64-linux -emit-pch %s -o %t
+// RUN: %clang_cc1 -std=c++98 -Wno-constant-evaluated -triple x86_64-linux -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s
 
-// RUN: %clang_cc1 -no-opaque-pointers -std=c++11 -Wno-constant-evaluated -triple x86_64-linux -include %s -verify %s -emit-llvm -o - | FileCheck %s --check-prefixes=CHECK,CXX11
-// RUN: %clang_cc1 -no-opaque-pointers -std=c++11 -Wno-constant-evaluated -triple x86_64-linux -emit-pch %s -o %t-cxx11
-// RUN: %clang_cc1 -no-opaque-pointers -std=c++11 -Wno-constant-evaluated -triple x86_64-linux -include-pch %t-cxx11 -verify %s -emit-llvm -o - | FileCheck %s --check-prefixes=CHECK,CXX11
+// RUN: %clang_cc1 -std=c++11 -Wno-constant-evaluated -triple x86_64-linux -include %s -verify %s -emit-llvm -o - | FileCheck %s --check-prefixes=CHECK,CXX11
+// RUN: %clang_cc1 -std=c++11 -Wno-constant-evaluated -triple x86_64-linux -emit-pch %s -o %t-cxx11
+// RUN: %clang_cc1 -std=c++11 -Wno-constant-evaluated -triple x86_64-linux -include-pch %t-cxx11 -verify %s -emit-llvm -o - | FileCheck %s --check-prefixes=CHECK,CXX11
 
-// RUN: %clang_cc1 -no-opaque-pointers -std=c++20 -Wno-constant-evaluated -triple x86_64-linux -include %s -verify %s -emit-llvm -o - | FileCheck %s --check-prefixes=CHECK,CXX11
-// RUN: %clang_cc1 -no-opaque-pointers -std=c++20 -Wno-constant-evaluated -triple x86_64-linux -emit-pch %s -o %t-cxx11
-// RUN: %clang_cc1 -no-opaque-pointers -std=c++20 -Wno-constant-evaluated -triple x86_64-linux -include-pch %t-cxx11 -verify %s -emit-llvm -o - | FileCheck %s --check-prefixes=CHECK,CXX11
+// RUN: %clang_cc1 -std=c++20 -Wno-constant-evaluated -triple x86_64-linux -include %s -verify %s -emit-llvm -o - | FileCheck %s --check-prefixes=CHECK,CXX11
+// RUN: %clang_cc1 -std=c++20 -Wno-constant-evaluated -triple x86_64-linux -emit-pch %s -o %t-cxx11
+// RUN: %clang_cc1 -std=c++20 -Wno-constant-evaluated -triple x86_64-linux -include-pch %t-cxx11 -verify %s -emit-llvm -o - | FileCheck %s --check-prefixes=CHECK,CXX11
 
 // expected-no-diagnostics
 
@@ -32,12 +32,12 @@ extern const float e = __builtin_is_constant_evaluated();
 void g(...);
 
 // CHECK-LABEL: define {{.*}} @_Z1fv(
-// CHECK:       store i8 0, i8* %[[A:.*]],
-// CHECK:       store i8 1, i8* %[[B:.*]],
-// CXX11:       store i8 1, i8* %[[C:.*]],
-// CHECK:       store float 0.000000e+00, float* %[[D:.*]],
-// CHECK:       store float 0.000000e+00, float* %[[E:.*]],
-// CHECK:       load i8, i8* %[[A]],
+// CHECK:       store i8 0, ptr %[[A:.*]],
+// CHECK:       store i8 1, ptr %[[B:.*]],
+// CXX11:       store i8 1, ptr %[[C:.*]],
+// CHECK:       store float 0.000000e+00, ptr %[[D:.*]],
+// CHECK:       store float 0.000000e+00, ptr %[[E:.*]],
+// CHECK:       load i8, ptr %[[A]],
 // CHECK:       call {{.*}} @_Z1gz(i32 noundef %{{[^,]+}}, i32 noundef 1
 // CXX11-SAME:  , i32 noundef 1
 // CHECK-SAME:  , double noundef %{{[^,]+}}, double noundef 0.000000e+00)

diff  --git a/clang/test/PCH/chain-openmp-threadprivate.cpp b/clang/test/PCH/chain-openmp-threadprivate.cpp
index 244134ed066c5..05cd65063789b 100644
--- a/clang/test/PCH/chain-openmp-threadprivate.cpp
+++ b/clang/test/PCH/chain-openmp-threadprivate.cpp
@@ -1,13 +1,13 @@
 // no PCH
-// RUN: %clang_cc1 -no-opaque-pointers -fopenmp -fnoopenmp-use-tls -emit-llvm -include %s -include %s %s -o - | FileCheck %s
+// RUN: %clang_cc1 -fopenmp -fnoopenmp-use-tls -emit-llvm -include %s -include %s %s -o - | FileCheck %s
 // with PCH
-// RUN: %clang_cc1 -no-opaque-pointers -fopenmp -fnoopenmp-use-tls -emit-llvm -chain-include %s -chain-include %s %s -o - | FileCheck %s
+// RUN: %clang_cc1 -fopenmp -fnoopenmp-use-tls -emit-llvm -chain-include %s -chain-include %s %s -o - | FileCheck %s
 // no PCH
-// RUN: %clang_cc1 -no-opaque-pointers -fopenmp -emit-llvm -include %s -include %s %s -o - | FileCheck %s -check-prefix=CHECK-TLS-1
-// RUN: %clang_cc1 -no-opaque-pointers -fopenmp -emit-llvm -include %s -include %s %s -o - | FileCheck %s -check-prefix=CHECK-TLS-2
+// RUN: %clang_cc1 -fopenmp -emit-llvm -include %s -include %s %s -o - | FileCheck %s -check-prefix=CHECK-TLS-1
+// RUN: %clang_cc1 -fopenmp -emit-llvm -include %s -include %s %s -o - | FileCheck %s -check-prefix=CHECK-TLS-2
 // with PCH
-// RUN: %clang_cc1 -no-opaque-pointers -fopenmp -emit-llvm -chain-include %s -chain-include %s %s -o - | FileCheck %s -check-prefix=CHECK-TLS-1
-// RUN: %clang_cc1 -no-opaque-pointers -fopenmp -emit-llvm -chain-include %s -chain-include %s %s -o - | FileCheck %s -check-prefix=CHECK-TLS-2
+// RUN: %clang_cc1 -fopenmp -emit-llvm -chain-include %s -chain-include %s %s -o - | FileCheck %s -check-prefix=CHECK-TLS-1
+// RUN: %clang_cc1 -fopenmp -emit-llvm -chain-include %s -chain-include %s %s -o - | FileCheck %s -check-prefix=CHECK-TLS-2
 
 #if !defined(PASS1)
 #define PASS1
@@ -23,7 +23,7 @@ int *a = malloc(20);
 #else
 
 // CHECK: call {{.*}} @__kmpc_threadprivate_register(
-// CHECK-TLS-1: @{{a|\"\?a@@3PE?AHE?A\"}} = {{.*}}thread_local {{.*}}global {{.*}}i32*
+// CHECK-TLS-1: @{{a|\"\?a@@3PE?AHE?A\"}} = {{.*}}thread_local {{.*}}global {{.*}}ptr
 
 // CHECK-LABEL: foo
 // CHECK-TLS-LABEL: foo

diff  --git a/clang/test/PCH/chain-pending-instantiations.cpp b/clang/test/PCH/chain-pending-instantiations.cpp
index f58e6e0fbdb77..6cd4f54f6ddd0 100644
--- a/clang/test/PCH/chain-pending-instantiations.cpp
+++ b/clang/test/PCH/chain-pending-instantiations.cpp
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -no-opaque-pointers %s -emit-llvm -triple i686-pc-linux -o - -chain-include %s -chain-include %s | FileCheck %s
-// CHECK: define linkonce_odr noundef %{{[^ ]+}} @_ZN1AI1BE3getEv
+// RUN: %clang_cc1 %s -emit-llvm -triple i686-pc-linux -o - -chain-include %s -chain-include %s | FileCheck %s
+// CHECK: define linkonce_odr noundef ptr @_ZN1AI1BE3getEv
 #if !defined(PASS1)
 #define PASS1
 

diff  --git a/clang/test/PCH/dllexport-default-arg-closure.cpp b/clang/test/PCH/dllexport-default-arg-closure.cpp
index bafc82398ac94..b5ac7815b8111 100644
--- a/clang/test/PCH/dllexport-default-arg-closure.cpp
+++ b/clang/test/PCH/dllexport-default-arg-closure.cpp
@@ -1,11 +1,11 @@
 // Make sure we emit the MS ABI default ctor closure with PCH.
 //
 // Test this without pch.
-// RUN: %clang_cc1 -no-opaque-pointers -fms-extensions -triple x86_64-windows-msvc -std=c++11 -include %s -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -fms-extensions -triple x86_64-windows-msvc -std=c++11 -include %s -emit-llvm -o - %s | FileCheck %s
 
 // Test with pch.
-// RUN: %clang_cc1 -no-opaque-pointers -fms-extensions -triple x86_64-windows-msvc -std=c++11 -emit-pch -o %t %s
-// RUN: %clang_cc1 -no-opaque-pointers -fms-extensions -triple x86_64-windows-msvc -std=c++11 -include-pch %t -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -fms-extensions -triple x86_64-windows-msvc -std=c++11 -emit-pch -o %t %s
+// RUN: %clang_cc1 -fms-extensions -triple x86_64-windows-msvc -std=c++11 -include-pch %t -emit-llvm -o - %s | FileCheck %s
 
 #ifndef HEADER
 #define HEADER
@@ -17,8 +17,8 @@ struct __declspec(dllexport) Foo {
 
 // Demangles as:
 // void Foo::`default constructor closure'(void)
-// CHECK: define weak_odr dso_local dllexport void @"??_FFoo@@QEAAXXZ"(%struct.Foo*{{.*}})
-// CHECK:   call noundef %struct.Foo* @"??0Foo@@QEAA at W4E@0@@Z"(%struct.Foo* {{.*}}, i32 noundef 0)
+// CHECK: define weak_odr dso_local dllexport void @"??_FFoo@@QEAAXXZ"(ptr{{.*}})
+// CHECK:   call noundef ptr @"??0Foo@@QEAA at W4E@0@@Z"(ptr {{.*}}, i32 noundef 0)
 
 #else
 

diff  --git a/clang/test/PCH/pr27445.cpp b/clang/test/PCH/pr27445.cpp
index 36871b7594010..de1ce8455fde4 100644
--- a/clang/test/PCH/pr27445.cpp
+++ b/clang/test/PCH/pr27445.cpp
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -no-opaque-pointers -triple x86_64-windows-msvc -fms-extensions -x c++ %S/Inputs/pr27445.h -emit-pch -o %t.pch
-// RUN: %clang_cc1 -no-opaque-pointers -triple x86_64-windows-msvc -fms-extensions %s -include-pch %t.pch -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-windows-msvc -fms-extensions -x c++ %S/Inputs/pr27445.h -emit-pch -o %t.pch
+// RUN: %clang_cc1 -triple x86_64-windows-msvc -fms-extensions %s -include-pch %t.pch -emit-llvm -o - | FileCheck %s
 
 class A;
 void fn1(A &) {}
@@ -10,5 +10,4 @@ class __declspec(dllexport) A {
   int field_;
 };
 
-// CHECK: %class.A = type { void (%struct.Info*)*, i32 }
-// CHECK: %struct.Info = type { i32 (...)** }
+// CHECK: %class.A = type { ptr, i32 }

diff  --git a/clang/test/PCH/pragma-weak-functional.c b/clang/test/PCH/pragma-weak-functional.c
index 5f4a4e9043a47..832729f1f1bff 100644
--- a/clang/test/PCH/pragma-weak-functional.c
+++ b/clang/test/PCH/pragma-weak-functional.c
@@ -1,14 +1,14 @@
 // Test this without pch.
-// RUN: %clang_cc1 -no-opaque-pointers -include %S/pragma-weak-functional.h %s -verify -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 -include %S/pragma-weak-functional.h %s -verify -emit-llvm -o - | FileCheck %s
 
 // Test with pch.
-// RUN: %clang_cc1 -no-opaque-pointers -x c-header -emit-pch -o %t %S/pragma-weak-functional.h
-// RUN: %clang_cc1 -no-opaque-pointers -include-pch %t %s -verify -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 -x c-header -emit-pch -o %t %S/pragma-weak-functional.h
+// RUN: %clang_cc1 -include-pch %t %s -verify -emit-llvm -o - | FileCheck %s
 
-// CHECK-DAG: @undecfunc_alias1 = weak{{.*}} alias void (), void ()* @undecfunc
-// CHECK-DAG: @undecfunc_alias2 = weak{{.*}} alias void (), void ()* @undecfunc
-// CHECK-DAG: @undecfunc_alias3 = weak{{.*}} alias void (), void ()* @undecfunc
-// CHECK-DAG: @undecfunc_alias4 = weak{{.*}} alias void (), void ()* @undecfunc
+// CHECK-DAG: @undecfunc_alias1 = weak{{.*}} alias void (), ptr @undecfunc
+// CHECK-DAG: @undecfunc_alias2 = weak{{.*}} alias void (), ptr @undecfunc
+// CHECK-DAG: @undecfunc_alias3 = weak{{.*}} alias void (), ptr @undecfunc
+// CHECK-DAG: @undecfunc_alias4 = weak{{.*}} alias void (), ptr @undecfunc
 
 ///////////// PR28611: Try multiple aliases of same undeclared symbol or alias
 void undecfunc_alias1(void);


        


More information about the cfe-commits mailing list