[clang] 428d38d - [CodeGenCXX] Convert some tests to opaque pointers (NFC)
Nikita Popov via cfe-commits
cfe-commits at lists.llvm.org
Wed Apr 5 07:20:25 PDT 2023
Author: Nikita Popov
Date: 2023-04-05T16:20:15+02:00
New Revision: 428d38da4443c15b2f1b51a239c341c98aa1f390
URL: https://github.com/llvm/llvm-project/commit/428d38da4443c15b2f1b51a239c341c98aa1f390
DIFF: https://github.com/llvm/llvm-project/commit/428d38da4443c15b2f1b51a239c341c98aa1f390.diff
LOG: [CodeGenCXX] Convert some tests to opaque pointers (NFC)
In particular also fixes fallout from instcombine changes.
Added:
Modified:
clang/test/CodeGenCXX/auto-var-init.cpp
clang/test/CodeGenCXX/microsoft-abi-dynamic-cast.cpp
clang/test/CodeGenCXX/microsoft-abi-typeid.cpp
Removed:
################################################################################
diff --git a/clang/test/CodeGenCXX/auto-var-init.cpp b/clang/test/CodeGenCXX/auto-var-init.cpp
index bc4197c0c10af..6cb18528ebadc 100644
--- a/clang/test/CodeGenCXX/auto-var-init.cpp
+++ b/clang/test/CodeGenCXX/auto-var-init.cpp
@@ -1,9 +1,9 @@
-// RUN: %clang_cc1 -no-opaque-pointers -std=c++14 -triple x86_64-unknown-unknown -fblocks %s -emit-llvm -o - | FileCheck %s -check-prefixes=CHECK,CHECK-O0
-// RUN: %clang_cc1 -no-opaque-pointers -std=c++14 -triple x86_64-unknown-unknown -fblocks -ftrivial-auto-var-init=pattern %s -emit-llvm -o - | FileCheck %s -check-prefixes=CHECK-O0,PATTERN,PATTERN-O0
-// RUN: %clang_cc1 -no-opaque-pointers -std=c++14 -triple x86_64-unknown-unknown -fblocks -ftrivial-auto-var-init=pattern %s -O1 -emit-llvm -o - | FileCheck %s -check-prefixes=CHECK-O1,PATTERN,PATTERN-O1
-// RUN: %clang_cc1 -no-opaque-pointers -std=c++14 -triple x86_64-unknown-unknown -fblocks -ftrivial-auto-var-init=zero %s -emit-llvm -o - | FileCheck %s -check-prefixes=CHECK-O0,ZERO,ZERO-O0
-// RUN: %clang_cc1 -no-opaque-pointers -std=c++14 -triple x86_64-unknown-unknown -fblocks -ftrivial-auto-var-init=zero %s -O1 -emit-llvm -o - | FileCheck %s -check-prefixes=CHECK-O1,ZERO,ZERO-O1
-// RUN: %clang_cc1 -no-opaque-pointers -std=c++14 -triple i386-unknown-unknown -fblocks -ftrivial-auto-var-init=pattern %s -emit-llvm -o - | FileCheck %s -check-prefixes=CHECK-O0,PATTERN,PATTERN-O0
+// RUN: %clang_cc1 -std=c++14 -triple x86_64-unknown-unknown -fblocks %s -emit-llvm -o - | FileCheck %s -check-prefixes=CHECK,CHECK-O0
+// RUN: %clang_cc1 -std=c++14 -triple x86_64-unknown-unknown -fblocks -ftrivial-auto-var-init=pattern %s -emit-llvm -o - | FileCheck %s -check-prefixes=CHECK-O0,PATTERN,PATTERN-O0
+// RUN: %clang_cc1 -std=c++14 -triple x86_64-unknown-unknown -fblocks -ftrivial-auto-var-init=pattern %s -O1 -emit-llvm -o - | FileCheck %s -check-prefixes=CHECK-O1,PATTERN,PATTERN-O1
+// RUN: %clang_cc1 -std=c++14 -triple x86_64-unknown-unknown -fblocks -ftrivial-auto-var-init=zero %s -emit-llvm -o - | FileCheck %s -check-prefixes=CHECK-O0,ZERO,ZERO-O0
+// RUN: %clang_cc1 -std=c++14 -triple x86_64-unknown-unknown -fblocks -ftrivial-auto-var-init=zero %s -O1 -emit-llvm -o - | FileCheck %s -check-prefixes=CHECK-O1,ZERO,ZERO-O1
+// RUN: %clang_cc1 -std=c++14 -triple i386-unknown-unknown -fblocks -ftrivial-auto-var-init=pattern %s -emit-llvm -o - | FileCheck %s -check-prefixes=CHECK-O0,PATTERN,PATTERN-O0
#pragma clang diagnostic ignored "-Winaccessible-base"
@@ -67,9 +67,9 @@ struct smallinit { char c = 42; };
// PATTERN-O1-NOT: @__const.test_smallpartinit_braces.braces
// PATTERN-O1-NOT: @__const.test_smallpartinit_custom.custom
struct smallpartinit { char c = 42, d; };
-// PATTERN-O0: @__const.test_nullinit_uninit.uninit = private unnamed_addr constant %struct.nullinit { i8* inttoptr ([[IPTRT]] [[IPTR]] to i8*) }, align
-// PATTERN-O0: @__const.test_nullinit_braces.braces = private unnamed_addr constant %struct.nullinit { i8* inttoptr ([[IPTRT]] [[IPTR]] to i8*) }, align
-// PATTERN-O0: @__const.test_nullinit_custom.custom = private unnamed_addr constant %struct.nullinit { i8* inttoptr ([[IPTRT]] [[IPTR]] to i8*) }, align
+// PATTERN-O0: @__const.test_nullinit_uninit.uninit = private unnamed_addr constant %struct.nullinit { ptr inttoptr ([[IPTRT]] [[IPTR]] to ptr) }, align
+// PATTERN-O0: @__const.test_nullinit_braces.braces = private unnamed_addr constant %struct.nullinit { ptr inttoptr ([[IPTRT]] [[IPTR]] to ptr) }, align
+// PATTERN-O0: @__const.test_nullinit_custom.custom = private unnamed_addr constant %struct.nullinit { ptr inttoptr ([[IPTRT]] [[IPTR]] to ptr) }, align
// PATTERN-O1-NOT: @__const.test_nullinit_uninit.uninit
// PATTERN-O1-NOT: @__const.test_nullinit_braces.braces
// PATTERN-O1-NOT: @__const.test_nullinit_custom.custom
@@ -142,8 +142,8 @@ struct arraytail { int i; int arr[]; };
// PATTERN-O1-NOT: @__const.test_bool4_custom.custom
// ZERO-O1-NOT: @__const.test_bool4_custom.custom
-// PATTERN: @__const.test_intptr4_custom.custom = private unnamed_addr constant [4 x i32*] [i32* inttoptr ([[IPTRT]] 572662306 to i32*), i32* inttoptr ([[IPTRT]] 572662306 to i32*), i32* inttoptr ([[IPTRT]] 572662306 to i32*), i32* inttoptr ([[IPTRT]] 572662306 to i32*)], align
-// ZERO: @__const.test_intptr4_custom.custom = private unnamed_addr constant [4 x i32*] [i32* inttoptr (i64 572662306 to i32*), i32* inttoptr (i64 572662306 to i32*), i32* inttoptr (i64 572662306 to i32*), i32* inttoptr (i64 572662306 to i32*)], align 16
+// PATTERN: @__const.test_intptr4_custom.custom = private unnamed_addr constant [4 x ptr] [ptr inttoptr ([[IPTRT]] 572662306 to ptr), ptr inttoptr ([[IPTRT]] 572662306 to ptr), ptr inttoptr ([[IPTRT]] 572662306 to ptr), ptr inttoptr ([[IPTRT]] 572662306 to ptr)], align
+// ZERO: @__const.test_intptr4_custom.custom = private unnamed_addr constant [4 x ptr] [ptr inttoptr (i64 572662306 to ptr), ptr inttoptr (i64 572662306 to ptr), ptr inttoptr (i64 572662306 to ptr), ptr inttoptr (i64 572662306 to ptr)], align 16
// PATTERN-O0: @__const.test_tailpad4_uninit.uninit = private unnamed_addr constant [4 x { i16, i8, [1 x i8] }] [{ i16, i8, [1 x i8] } { i16 [[I16]], i8 [[I8]], [1 x i8] c"\[[IC]]" }, { i16, i8, [1 x i8] } { i16 [[I16]], i8 [[I8]], [1 x i8] c"\[[IC]]" }, { i16, i8, [1 x i8] } { i16 [[I16]], i8 [[I8]], [1 x i8] c"\[[IC]]" }, { i16, i8, [1 x i8] } { i16 [[I16]], i8 [[I8]], [1 x i8] c"\[[IC]]" }], align
// PATTERN-O1-NOT: @__const.test_tailpad4_uninit.uninit
// PATTERN: @__const.test_tailpad4_custom.custom = private unnamed_addr constant [4 x { i16, i8, [1 x i8] }] [{ i16, i8, [1 x i8] } { i16 257, i8 1, [1 x i8] zeroinitializer }, { i16, i8, [1 x i8] } { i16 257, i8 1, [1 x i8] zeroinitializer }, { i16, i8, [1 x i8] } { i16 257, i8 1, [1 x i8] zeroinitializer }, { i16, i8, [1 x i8] } { i16 257, i8 1, [1 x i8] zeroinitializer }], align
@@ -181,19 +181,19 @@ struct semivolatile { int i; volatile int vi; };
// ZERO-O0: @__const.test_semivolatile_custom.custom = private unnamed_addr constant %struct.semivolatile { i32 1145324612, i32 1145324612 }, align 4
// ZERO-O1-NOT: @__const.test_semivolatile_custom.custom
struct semivolatileinit { int i = 0x11111111; volatile int vi = 0x11111111; };
-// PATTERN-O0: @__const.test_base_uninit.uninit = private unnamed_addr constant %struct.base { i32 (...)** inttoptr ([[IPTRT]] [[IPTR]] to i32 (...)**) }, align
+// PATTERN-O0: @__const.test_base_uninit.uninit = private unnamed_addr constant %struct.base { ptr inttoptr ([[IPTRT]] [[IPTR]] to ptr) }, align
// PATTERN-O1-NOT: @__const.test_base_uninit.uninit
-// PATTERN-O0: @__const.test_base_braces.braces = private unnamed_addr constant %struct.base { i32 (...)** inttoptr ([[IPTRT]] [[IPTR]] to i32 (...)**) }, align
+// PATTERN-O0: @__const.test_base_braces.braces = private unnamed_addr constant %struct.base { ptr inttoptr ([[IPTRT]] [[IPTR]] to ptr) }, align
// PATTERN-O1-NOT: @__const.test_base_braces.braces
struct base { virtual ~base(); };
-// PATTERN-O0: @__const.test_derived_uninit.uninit = private unnamed_addr constant %struct.derived { %struct.base { i32 (...)** inttoptr ([[IPTRT]] [[IPTR]] to i32 (...)**) } }, align
+// PATTERN-O0: @__const.test_derived_uninit.uninit = private unnamed_addr constant %struct.derived { %struct.base { ptr inttoptr ([[IPTRT]] [[IPTR]] to ptr) } }, align
// PATTERN-O1-NOT: @__const.test_derived_uninit.uninit
-// PATTERN-O0: @__const.test_derived_braces.braces = private unnamed_addr constant %struct.derived { %struct.base { i32 (...)** inttoptr ([[IPTRT]] [[IPTR]] to i32 (...)**) } }, align
+// PATTERN-O0: @__const.test_derived_braces.braces = private unnamed_addr constant %struct.derived { %struct.base { ptr inttoptr ([[IPTRT]] [[IPTR]] to ptr) } }, align
// PATTERN-O1-NOT: @__const.test_derived_braces.braces
struct derived : public base {};
-// PATTERN-O0: @__const.test_virtualderived_uninit.uninit = private unnamed_addr constant %struct.virtualderived { %struct.base { i32 (...)** inttoptr ([[IPTRT]] [[IPTR]] to i32 (...)**) }, %struct.derived { %struct.base { i32 (...)** inttoptr ([[IPTRT]] [[IPTR]] to i32 (...)**) } } }, align
+// PATTERN-O0: @__const.test_virtualderived_uninit.uninit = private unnamed_addr constant %struct.virtualderived { %struct.base { ptr inttoptr ([[IPTRT]] [[IPTR]] to ptr) }, %struct.derived { %struct.base { ptr inttoptr ([[IPTRT]] [[IPTR]] to ptr) } } }, align
// PATTERN-O1-NOT: @__const.test_virtualderived_uninit.uninit
-// PATTERN-O0: @__const.test_virtualderived_braces.braces = private unnamed_addr constant %struct.virtualderived { %struct.base { i32 (...)** inttoptr ([[IPTRT]] [[IPTR]] to i32 (...)**) }, %struct.derived { %struct.base { i32 (...)** inttoptr ([[IPTRT]] [[IPTR]] to i32 (...)**) } } }, align
+// PATTERN-O0: @__const.test_virtualderived_braces.braces = private unnamed_addr constant %struct.virtualderived { %struct.base { ptr inttoptr ([[IPTRT]] [[IPTR]] to ptr) }, %struct.derived { %struct.base { ptr inttoptr ([[IPTRT]] [[IPTR]] to ptr) } } }, align
// PATTERN-O1-NOT: @__const.test_virtualderived_braces.braces
struct virtualderived : public virtual base, public virtual derived {};
// PATTERN-O0: @__const.test_matching_uninit.uninit = private unnamed_addr constant %union.matching { i32 [[I32]] }, align 4
@@ -241,14 +241,14 @@ TEST_UNINIT(char, char);
// CHECK: %uninit = alloca i8, align
// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)
// PATTERN-LABEL: @test_char_uninit()
-// PATTERN: store i8 [[I8]], i8* %uninit, align 1, !annotation [[AUTO_INIT:!.+]]
+// PATTERN: store i8 [[I8]], ptr %uninit, align 1, !annotation [[AUTO_INIT:!.+]]
// ZERO-LABEL: @test_char_uninit()
-// ZERO: store i8 0, i8* %uninit, align 1, !annotation [[AUTO_INIT:!.+]]
+// ZERO: store i8 0, ptr %uninit, align 1, !annotation [[AUTO_INIT:!.+]]
TEST_BRACES(char, char);
// CHECK-LABEL: @test_char_braces()
// CHECK: %braces = alloca i8, align [[ALIGN:[0-9]*]]
-// CHECK-NEXT: store i8 0, i8* %braces, align [[ALIGN]]
+// CHECK-NEXT: store i8 0, ptr %braces, align [[ALIGN]]
// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)
TEST_UNINIT(uchar, unsigned char);
@@ -256,14 +256,14 @@ TEST_UNINIT(uchar, unsigned char);
// CHECK: %uninit = alloca i8, align
// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)
// PATTERN-LABEL: @test_uchar_uninit()
-// PATTERN: store i8 [[I8]], i8* %uninit, align 1, !annotation [[AUTO_INIT]]
+// PATTERN: store i8 [[I8]], ptr %uninit, align 1, !annotation [[AUTO_INIT]]
// ZERO-LABEL: @test_uchar_uninit()
-// ZERO: store i8 0, i8* %uninit, align 1, !annotation [[AUTO_INIT]]
+// ZERO: store i8 0, ptr %uninit, align 1, !annotation [[AUTO_INIT]]
TEST_BRACES(uchar, unsigned char);
// CHECK-LABEL: @test_uchar_braces()
// CHECK: %braces = alloca i8, align [[ALIGN:[0-9]*]]
-// CHECK-NEXT: store i8 0, i8* %braces, align [[ALIGN]]
+// CHECK-NEXT: store i8 0, ptr %braces, align [[ALIGN]]
// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)
TEST_UNINIT(schar, signed char);
@@ -271,14 +271,14 @@ TEST_UNINIT(schar, signed char);
// CHECK: %uninit = alloca i8, align
// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)
// PATTERN-LABEL: @test_schar_uninit()
-// PATTERN: store i8 [[I8]], i8* %uninit, align 1, !annotation [[AUTO_INIT]]
+// PATTERN: store i8 [[I8]], ptr %uninit, align 1, !annotation [[AUTO_INIT]]
// ZERO-LABEL: @test_schar_uninit()
-// ZERO: store i8 0, i8* %uninit, align 1, !annotation [[AUTO_INIT]]
+// ZERO: store i8 0, ptr %uninit, align 1, !annotation [[AUTO_INIT]]
TEST_BRACES(schar, signed char);
// CHECK-LABEL: @test_schar_braces()
// CHECK: %braces = alloca i8, align [[ALIGN:[0-9]*]]
-// CHECK-NEXT: store i8 0, i8* %braces, align [[ALIGN]]
+// CHECK-NEXT: store i8 0, ptr %braces, align [[ALIGN]]
// CHECK-NOT: !annotation
// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)
@@ -287,14 +287,14 @@ TEST_UNINIT(wchar_t, wchar_t);
// CHECK: %uninit = alloca i32, align
// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)
// PATTERN-LABEL: @test_wchar_t_uninit()
-// PATTERN: store i32 [[I32]], i32* %uninit, align 4, !annotation [[AUTO_INIT]]
+// PATTERN: store i32 [[I32]], ptr %uninit, align 4, !annotation [[AUTO_INIT]]
// ZERO-LABEL: @test_wchar_t_uninit()
-// ZERO: store i32 0, i32* %uninit, align 4, !annotation [[AUTO_INIT]]
+// ZERO: store i32 0, ptr %uninit, align 4, !annotation [[AUTO_INIT]]
TEST_BRACES(wchar_t, wchar_t);
// CHECK-LABEL: @test_wchar_t_braces()
// CHECK: %braces = alloca i32, align [[ALIGN:[0-9]*]]
-// CHECK-NEXT: store i32 0, i32* %braces, align [[ALIGN]]
+// CHECK-NEXT: store i32 0, ptr %braces, align [[ALIGN]]
// CHECK-NOT: !annotation
// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)
@@ -303,14 +303,14 @@ TEST_UNINIT(short, short);
// CHECK: %uninit = alloca i16, align
// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)
// PATTERN-LABEL: @test_short_uninit()
-// PATTERN: store i16 [[I16]], i16* %uninit, align 2, !annotation [[AUTO_INIT]]
+// PATTERN: store i16 [[I16]], ptr %uninit, align 2, !annotation [[AUTO_INIT]]
// ZERO-LABEL: @test_short_uninit()
-// ZERO: store i16 0, i16* %uninit, align 2, !annotation [[AUTO_INIT]]
+// ZERO: store i16 0, ptr %uninit, align 2, !annotation [[AUTO_INIT]]
TEST_BRACES(short, short);
// CHECK-LABEL: @test_short_braces()
// CHECK: %braces = alloca i16, align [[ALIGN:[0-9]*]]
-// CHECK-NEXT: store i16 0, i16* %braces, align [[ALIGN]]
+// CHECK-NEXT: store i16 0, ptr %braces, align [[ALIGN]]
// CHECK-NOT: !annotation
// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)
@@ -319,14 +319,14 @@ TEST_UNINIT(ushort, unsigned short);
// CHECK: %uninit = alloca i16, align
// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)
// PATTERN-LABEL: @test_ushort_uninit()
-// PATTERN: store i16 [[I16]], i16* %uninit, align 2, !annotation [[AUTO_INIT]]
+// PATTERN: store i16 [[I16]], ptr %uninit, align 2, !annotation [[AUTO_INIT]]
// ZERO-LABEL: @test_ushort_uninit()
-// ZERO: store i16 0, i16* %uninit, align 2, !annotation [[AUTO_INIT]]
+// ZERO: store i16 0, ptr %uninit, align 2, !annotation [[AUTO_INIT]]
TEST_BRACES(ushort, unsigned short);
// CHECK-LABEL: @test_ushort_braces()
// CHECK: %braces = alloca i16, align [[ALIGN:[0-9]*]]
-// CHECK-NEXT: store i16 0, i16* %braces, align [[ALIGN]]
+// CHECK-NEXT: store i16 0, ptr %braces, align [[ALIGN]]
//CHECK-NOT: !annotation
// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)
@@ -335,14 +335,14 @@ TEST_UNINIT(int, int);
// CHECK: %uninit = alloca i32, align
// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)
// PATTERN-LABEL: @test_int_uninit()
-// PATTERN: store i32 [[I32]], i32* %uninit, align 4, !annotation [[AUTO_INIT]]
+// PATTERN: store i32 [[I32]], ptr %uninit, align 4, !annotation [[AUTO_INIT]]
// ZERO-LABEL: @test_int_uninit()
-// ZERO: store i32 0, i32* %uninit, align 4, !annotation [[AUTO_INIT]]
+// ZERO: store i32 0, ptr %uninit, align 4, !annotation [[AUTO_INIT]]
TEST_BRACES(int, int);
// CHECK-LABEL: @test_int_braces()
// CHECK: %braces = alloca i32, align [[ALIGN:[0-9]*]]
-// CHECK-NEXT: store i32 0, i32* %braces, align [[ALIGN]]
+// CHECK-NEXT: store i32 0, ptr %braces, align [[ALIGN]]
// CHECK-NOT: !annotation
// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)
@@ -351,14 +351,14 @@ TEST_UNINIT(unsigned, unsigned);
// CHECK: %uninit = alloca i32, align
// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)
// PATTERN-LABEL: @test_unsigned_uninit()
-// PATTERN: store i32 [[I32]], i32* %uninit, align 4, !annotation [[AUTO_INIT]]
+// PATTERN: store i32 [[I32]], ptr %uninit, align 4, !annotation [[AUTO_INIT]]
// ZERO-LABEL: @test_unsigned_uninit()
-// ZERO: store i32 0, i32* %uninit, align 4, !annotation [[AUTO_INIT]]
+// ZERO: store i32 0, ptr %uninit, align 4, !annotation [[AUTO_INIT]]
TEST_BRACES(unsigned, unsigned);
// CHECK-LABEL: @test_unsigned_braces()
// CHECK: %braces = alloca i32, align [[ALIGN:[0-9]*]]
-// CHECK-NEXT: store i32 0, i32* %braces, align [[ALIGN]]
+// CHECK-NEXT: store i32 0, ptr %braces, align [[ALIGN]]
// CHECK-NOT: !annotation
// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)
@@ -367,14 +367,14 @@ TEST_UNINIT(long, long);
// CHECK: %uninit = alloca i64, align
// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)
// PATTERN-LABEL: @test_long_uninit()
-// PATTERN: store [[ILONGT]] [[ILONG]], [[ILONGT]]* %uninit, align {{.+}}, !annotation [[AUTO_INIT]]
+// PATTERN: store [[ILONGT]] [[ILONG]], ptr %uninit, align {{.+}}, !annotation [[AUTO_INIT]]
// ZERO-LABEL: @test_long_uninit()
-// ZERO: store i64 0, i64* %uninit, align 8, !annotation [[AUTO_INIT]]
+// ZERO: store i64 0, ptr %uninit, align 8, !annotation [[AUTO_INIT]]
TEST_BRACES(long, long);
// CHECK-LABEL: @test_long_braces()
// CHECK: %braces = alloca i64, align [[ALIGN:[0-9]*]]
-// CHECK-NEXT: store i64 0, i64* %braces, align [[ALIGN]]
+// CHECK-NEXT: store i64 0, ptr %braces, align [[ALIGN]]
// CHECK-NOT: !annotation
// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)
@@ -383,14 +383,14 @@ TEST_UNINIT(ulong, unsigned long);
// CHECK: %uninit = alloca i64, align
// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)
// PATTERN-LABEL: @test_ulong_uninit()
-// PATTERN: store [[ILONGT]] [[ILONG]], [[ILONGT]]* %uninit, align {{.+}}, !annotation [[AUTO_INIT]]
+// PATTERN: store [[ILONGT]] [[ILONG]], ptr %uninit, align {{.+}}, !annotation [[AUTO_INIT]]
// ZERO-LABEL: @test_ulong_uninit()
-// ZERO: store i64 0, i64* %uninit, align 8, !annotation [[AUTO_INIT]]
+// ZERO: store i64 0, ptr %uninit, align 8, !annotation [[AUTO_INIT]]
TEST_BRACES(ulong, unsigned long);
// CHECK-LABEL: @test_ulong_braces()
// CHECK: %braces = alloca i64, align [[ALIGN:[0-9]*]]
-// CHECK-NEXT: store i64 0, i64* %braces, align [[ALIGN]]
+// CHECK-NEXT: store i64 0, ptr %braces, align [[ALIGN]]
// CHECK-NOT: !annotation
// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)
@@ -399,14 +399,14 @@ TEST_UNINIT(longlong, long long);
// CHECK: %uninit = alloca i64, align
// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)
// PATTERN-LABEL: @test_longlong_uninit()
-// PATTERN: store i64 [[I64]], i64* %uninit, align 8, !annotation [[AUTO_INIT]]
+// PATTERN: store i64 [[I64]], ptr %uninit, align 8, !annotation [[AUTO_INIT]]
// ZERO-LABEL: @test_longlong_uninit()
-// ZERO: store i64 0, i64* %uninit, align 8, !annotation [[AUTO_INIT]]
+// ZERO: store i64 0, ptr %uninit, align 8, !annotation [[AUTO_INIT]]
TEST_BRACES(longlong, long long);
// CHECK-LABEL: @test_longlong_braces()
// CHECK: %braces = alloca i64, align [[ALIGN:[0-9]*]]
-// CHECK-NEXT: store i64 0, i64* %braces, align [[ALIGN]]
+// CHECK-NEXT: store i64 0, ptr %braces, align [[ALIGN]]
// CHECK-NOT: !annotation
// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)
@@ -415,14 +415,14 @@ TEST_UNINIT(ulonglong, unsigned long long);
// CHECK: %uninit = alloca i64, align
// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)
// PATTERN-LABEL: @test_ulonglong_uninit()
-// PATTERN: store i64 [[I64]], i64* %uninit, align 8, !annotation [[AUTO_INIT]]
+// PATTERN: store i64 [[I64]], ptr %uninit, align 8, !annotation [[AUTO_INIT]]
// ZERO-LABEL: @test_ulonglong_uninit()
-// ZERO: store i64 0, i64* %uninit, align 8, !annotation [[AUTO_INIT]]
+// ZERO: store i64 0, ptr %uninit, align 8, !annotation [[AUTO_INIT]]
TEST_BRACES(ulonglong, unsigned long long);
// CHECK-LABEL: @test_ulonglong_braces()
// CHECK: %braces = alloca i64, align [[ALIGN:[0-9]*]]
-// CHECK-NEXT: store i64 0, i64* %braces, align [[ALIGN]]
+// CHECK-NEXT: store i64 0, ptr %braces, align [[ALIGN]]
// CHECK-NOT: !annotation
// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)
@@ -431,14 +431,14 @@ TEST_UNINIT(int128, __int128);
// CHECK: %uninit = alloca i128, align
// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)
// PATTERN-LABEL: @test_int128_uninit()
-// PATTERN: store [[I128T]] [[I128]], [[I128T]]* %uninit, align {{.+}}, !annotation [[AUTO_INIT]]
+// PATTERN: store [[I128T]] [[I128]], ptr %uninit, align {{.+}}, !annotation [[AUTO_INIT]]
// ZERO-LABEL: @test_int128_uninit()
-// ZERO: store i128 0, i128* %uninit, align 16, !annotation [[AUTO_INIT]]
+// ZERO: store i128 0, ptr %uninit, align 16, !annotation [[AUTO_INIT]]
TEST_BRACES(int128, __int128);
// CHECK-LABEL: @test_int128_braces()
// CHECK: %braces = alloca i128, align [[ALIGN:[0-9]*]]
-// CHECK-NEXT: store i128 0, i128* %braces, align [[ALIGN]]
+// CHECK-NEXT: store i128 0, ptr %braces, align [[ALIGN]]
// CHECK-NOT: !annotation
// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)
@@ -447,14 +447,14 @@ TEST_UNINIT(uint128, unsigned __int128);
// CHECK: %uninit = alloca i128, align
// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)
// PATTERN-LABEL: @test_uint128_uninit()
-// PATTERN: store [[I128T]] [[I128]], [[I128T]]* %uninit, align {{.+}}, !annotation [[AUTO_INIT]]
+// PATTERN: store [[I128T]] [[I128]], ptr %uninit, align {{.+}}, !annotation [[AUTO_INIT]]
// ZERO-LABEL: @test_uint128_uninit()
-// ZERO: store i128 0, i128* %uninit, align 16, !annotation [[AUTO_INIT]]
+// ZERO: store i128 0, ptr %uninit, align 16, !annotation [[AUTO_INIT]]
TEST_BRACES(uint128, unsigned __int128);
// CHECK-LABEL: @test_uint128_braces()
// CHECK: %braces = alloca i128, align [[ALIGN:[0-9]*]]
-// CHECK-NEXT: store i128 0, i128* %braces, align [[ALIGN]]
+// CHECK-NEXT: store i128 0, ptr %braces, align [[ALIGN]]
// CHECK-NOT: !annotation
// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)
@@ -463,14 +463,14 @@ TEST_UNINIT(fp16, __fp16);
// CHECK: %uninit = alloca half, align
// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)
// PATTERN-LABEL: @test_fp16_uninit()
-// PATTERN: store half 0xHFFFF, half* %uninit, align 2, !annotation [[AUTO_INIT]]
+// PATTERN: store half 0xHFFFF, ptr %uninit, align 2, !annotation [[AUTO_INIT]]
// ZERO-LABEL: @test_fp16_uninit()
-// ZERO: store half 0xH0000, half* %uninit, align 2, !annotation [[AUTO_INIT]]
+// ZERO: store half 0xH0000, ptr %uninit, align 2, !annotation [[AUTO_INIT]]
TEST_BRACES(fp16, __fp16);
// CHECK-LABEL: @test_fp16_braces()
// CHECK: %braces = alloca half, align [[ALIGN:[0-9]*]]
-// CHECK-NEXT: store half 0xH0000, half* %braces, align [[ALIGN]]
+// CHECK-NEXT: store half 0xH0000, ptr %braces, align [[ALIGN]]
// CHECK-NOT: !annotation
// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)
@@ -479,14 +479,14 @@ TEST_UNINIT(float, float);
// CHECK: %uninit = alloca float, align
// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)
// PATTERN-LABEL: @test_float_uninit()
-// PATTERN: store float 0xFFFFFFFFE0000000, float* %uninit, align 4, !annotation [[AUTO_INIT]]
+// PATTERN: store float 0xFFFFFFFFE0000000, ptr %uninit, align 4, !annotation [[AUTO_INIT]]
// ZERO-LABEL: @test_float_uninit()
-// ZERO: store float 0.000000e+00, float* %uninit, align 4, !annotation [[AUTO_INIT]]
+// ZERO: store float 0.000000e+00, ptr %uninit, align 4, !annotation [[AUTO_INIT]]
TEST_BRACES(float, float);
// CHECK-LABEL: @test_float_braces()
// CHECK: %braces = alloca float, align [[ALIGN:[0-9]*]]
-// CHECK-NEXT: store float 0.000000e+00, float* %braces, align [[ALIGN]]
+// CHECK-NEXT: store float 0.000000e+00, ptr %braces, align [[ALIGN]]
// CHECK-NOT: !annotation
// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)
@@ -495,14 +495,14 @@ TEST_UNINIT(double, double);
// CHECK: %uninit = alloca double, align
// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)
// PATTERN-LABEL: @test_double_uninit()
-// PATTERN: store double 0xFFFFFFFFFFFFFFFF, double* %uninit, align 8, !annotation [[AUTO_INIT]]
+// PATTERN: store double 0xFFFFFFFFFFFFFFFF, ptr %uninit, align 8, !annotation [[AUTO_INIT]]
// ZERO-LABEL: @test_double_uninit()
-// ZERO: store double 0.000000e+00, double* %uninit, align 8, !annotation [[AUTO_INIT]]
+// ZERO: store double 0.000000e+00, ptr %uninit, align 8, !annotation [[AUTO_INIT]]
TEST_BRACES(double, double);
// CHECK-LABEL: @test_double_braces()
// CHECK: %braces = alloca double, align [[ALIGN:[0-9]*]]
-// CHECK-NEXT: store double 0.000000e+00, double* %braces, align [[ALIGN]]
+// CHECK-NEXT: store double 0.000000e+00, ptr %braces, align [[ALIGN]]
// CHECK-NOT: !annotation
// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)
@@ -511,62 +511,62 @@ TEST_UNINIT(longdouble, long double);
// CHECK: %uninit = alloca x86_fp80, align
// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)
// PATTERN-LABEL: @test_longdouble_uninit()
-// PATTERN: store x86_fp80 0xKFFFFFFFFFFFFFFFFFFFF, x86_fp80* %uninit, align {{.+}}, !annotation [[AUTO_INIT]]
+// PATTERN: store x86_fp80 0xKFFFFFFFFFFFFFFFFFFFF, ptr %uninit, align {{.+}}, !annotation [[AUTO_INIT]]
// ZERO-LABEL: @test_longdouble_uninit()
-// ZERO: store x86_fp80 0xK00000000000000000000, x86_fp80* %uninit, align {{.+}}, !annotation [[AUTO_INIT]]
+// ZERO: store x86_fp80 0xK00000000000000000000, ptr %uninit, align {{.+}}, !annotation [[AUTO_INIT]]
TEST_BRACES(longdouble, long double);
// CHECK-LABEL: @test_longdouble_braces()
// CHECK: %braces = alloca x86_fp80, align [[ALIGN:[0-9]*]]
-// CHECK-NEXT: store x86_fp80 0xK00000000000000000000, x86_fp80* %braces, align [[ALIGN]]
+// CHECK-NEXT: store x86_fp80 0xK00000000000000000000, ptr %braces, align [[ALIGN]]
// CHECK-NOT: !annotation
// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)
TEST_UNINIT(intptr, int*);
// CHECK-LABEL: @test_intptr_uninit()
-// CHECK: %uninit = alloca i32*, align
+// CHECK: %uninit = alloca ptr, align
// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)
// PATTERN-LABEL: @test_intptr_uninit()
-// PATTERN: store i32* inttoptr ([[IPTRT]] [[IPTR]] to i32*), i32** %uninit, align {{.+}}, !annotation [[AUTO_INIT]]
+// PATTERN: store ptr inttoptr ([[IPTRT]] [[IPTR]] to ptr), ptr %uninit, align {{.+}}, !annotation [[AUTO_INIT]]
// ZERO-LABEL: @test_intptr_uninit()
-// ZERO: store i32* null, i32** %uninit, align {{.+}}, !annotation [[AUTO_INIT]]
+// ZERO: store ptr null, ptr %uninit, align {{.+}}, !annotation [[AUTO_INIT]]
TEST_BRACES(intptr, int*);
// CHECK-LABEL: @test_intptr_braces()
-// CHECK: %braces = alloca i32*, align [[ALIGN:[0-9]*]]
-// CHECK-NEXT: store i32* null, i32** %braces, align [[ALIGN]]
+// CHECK: %braces = alloca ptr, align [[ALIGN:[0-9]*]]
+// CHECK-NEXT: store ptr null, ptr %braces, align [[ALIGN]]
// CHECK-NOT: !annotation
// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)
TEST_UNINIT(intptrptr, int**);
// CHECK-LABEL: @test_intptrptr_uninit()
-// CHECK: %uninit = alloca i32**, align
+// CHECK: %uninit = alloca ptr, align
// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)
// PATTERN-LABEL: @test_intptrptr_uninit()
-// PATTERN: store i32** inttoptr ([[IPTRT]] [[IPTR]] to i32**), i32*** %uninit, align {{.+}}, !annotation [[AUTO_INIT]]
+// PATTERN: store ptr inttoptr ([[IPTRT]] [[IPTR]] to ptr), ptr %uninit, align {{.+}}, !annotation [[AUTO_INIT]]
// ZERO-LABEL: @test_intptrptr_uninit()
-// ZERO: store i32** null, i32*** %uninit, align {{.+}}, !annotation [[AUTO_INIT]]
+// ZERO: store ptr null, ptr %uninit, align {{.+}}, !annotation [[AUTO_INIT]]
TEST_BRACES(intptrptr, int**);
// CHECK-LABEL: @test_intptrptr_braces()
-// CHECK: %braces = alloca i32**, align [[ALIGN:[0-9]*]]
-// CHECK-NEXT: store i32** null, i32*** %braces, align [[ALIGN]]
+// CHECK: %braces = alloca ptr, align [[ALIGN:[0-9]*]]
+// CHECK-NEXT: store ptr null, ptr %braces, align [[ALIGN]]
// CHECK-NOT: !annotation
// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)
TEST_UNINIT(function, void(*)());
// CHECK-LABEL: @test_function_uninit()
-// CHECK: %uninit = alloca void ()*, align
+// CHECK: %uninit = alloca ptr, align
// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)
// PATTERN-LABEL: @test_function_uninit()
-// PATTERN: store void ()* inttoptr ([[IPTRT]] [[IPTR]] to void ()*), void ()** %uninit, align {{.+}}, !annotation [[AUTO_INIT]]
+// PATTERN: store ptr inttoptr ([[IPTRT]] [[IPTR]] to ptr), ptr %uninit, align {{.+}}, !annotation [[AUTO_INIT]]
// ZERO-LABEL: @test_function_uninit()
-// ZERO: store void ()* null, void ()** %uninit, align {{.+}}, !annotation [[AUTO_INIT]]
+// ZERO: store ptr null, ptr %uninit, align {{.+}}, !annotation [[AUTO_INIT]]
TEST_BRACES(function, void(*)());
// CHECK-LABEL: @test_function_braces()
-// CHECK: %braces = alloca void ()*, align [[ALIGN:[0-9]*]]
-// CHECK-NEXT: store void ()* null, void ()** %braces, align [[ALIGN]]
+// CHECK: %braces = alloca ptr, align [[ALIGN:[0-9]*]]
+// CHECK-NEXT: store ptr null, ptr %braces, align [[ALIGN]]
// CHECK-NOT: !annotation
// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)
@@ -575,14 +575,14 @@ TEST_UNINIT(bool, bool);
// CHECK: %uninit = alloca i8, align
// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)
// PATTERN-LABEL: @test_bool_uninit()
-// PATTERN: store i8 [[I8]], i8* %uninit, align 1, !annotation [[AUTO_INIT]]
+// PATTERN: store i8 [[I8]], ptr %uninit, align 1, !annotation [[AUTO_INIT]]
// ZERO-LABEL: @test_bool_uninit()
-// ZERO: store i8 0, i8* %uninit, align 1, !annotation [[AUTO_INIT]]
+// ZERO: store i8 0, ptr %uninit, align 1, !annotation [[AUTO_INIT]]
TEST_BRACES(bool, bool);
// CHECK-LABEL: @test_bool_braces()
// CHECK: %braces = alloca i8, align [[ALIGN:[0-9]*]]
-// CHECK-NEXT: store i8 0, i8* %braces, align [[ALIGN]]
+// CHECK-NEXT: store i8 0, ptr %braces, align [[ALIGN]]
// CHECK-NOT: !annotation
// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)
@@ -600,7 +600,6 @@ TEST_UNINIT(empty, empty);
TEST_BRACES(empty, empty);
// CHECK-LABEL: @test_empty_braces()
// CHECK: %braces = alloca %struct.empty, align
-// CHECK-NEXT: bitcast
// CHECK-NEXT: call void @llvm.memcpy
// CHECK-NOT: !annotation
// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)
@@ -619,15 +618,13 @@ TEST_UNINIT(small, small);
TEST_BRACES(small, small);
// CHECK-LABEL: @test_small_braces()
// CHECK: %braces = alloca %struct.small, align [[ALIGN:[0-9]*]]
-// CHECK-NEXT: bitcast
-// CHECK-NEXT: call void @llvm.memset{{.*}}(i8* align [[ALIGN]] %{{.*}}, i8 0, i64 1, i1 false)
+// CHECK-NEXT: call void @llvm.memset{{.*}}(ptr align [[ALIGN]] %{{.*}}, i8 0, i64 1, i1 false)
// CHECK-NOT: !annotation
// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)
TEST_CUSTOM(small, small, { 42 });
// CHECK-LABEL: @test_small_custom()
// CHECK: %custom = alloca %struct.small, align
-// CHECK-NEXT: bitcast
// CHECK-NEXT: call void @llvm.memcpy
// CHECK-NOT: !annotation
// CHECK-NEXT: call void @{{.*}}used{{.*}}%custom)
@@ -641,16 +638,16 @@ TEST_UNINIT(smallinit, smallinit);
TEST_BRACES(smallinit, smallinit);
// CHECK-LABEL: @test_smallinit_braces()
// CHECK: %braces = alloca %struct.smallinit, align [[ALIGN:[0-9]*]]
-// CHECK-NEXT: %[[C:[^ ]*]] = getelementptr inbounds %struct.smallinit, %struct.smallinit* %braces, i32 0, i32 0
-// CHECK-NEXT: store i8 42, i8* %[[C]], align [[ALIGN]]
+// CHECK-NEXT: %[[C:[^ ]*]] = getelementptr inbounds %struct.smallinit, ptr %braces, i32 0, i32 0
+// CHECK-NEXT: store i8 42, ptr %[[C]], align [[ALIGN]]
// CHECK-NOT: !annotation
// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)
TEST_CUSTOM(smallinit, smallinit, { 100 });
// CHECK-LABEL: @test_smallinit_custom()
// CHECK: %custom = alloca %struct.smallinit, align [[ALIGN:[0-9]*]]
-// CHECK-NEXT: %[[C:[^ ]*]] = getelementptr inbounds %struct.smallinit, %struct.smallinit* %custom, i32 0, i32 0
-// CHECK-NEXT: store i8 100, i8* %[[C]], align [[ALIGN]]
+// CHECK-NEXT: %[[C:[^ ]*]] = getelementptr inbounds %struct.smallinit, ptr %custom, i32 0, i32 0
+// CHECK-NEXT: store i8 100, ptr %[[C]], align [[ALIGN]]
// CHECK-NOT: !annotation
// CHECK-NEXT: call void @{{.*}}used{{.*}}%custom)
@@ -665,27 +662,27 @@ TEST_UNINIT(smallpartinit, smallpartinit);
// PATTERN-O1: store i8 42, {{.*}} align 1
// ZERO-LABEL: @test_smallpartinit_uninit()
// ZERO-O0: call void @llvm.memset{{.*}}, i8 0,{{.+}}), !annotation [[AUTO_INIT]]
-// ZERO-O1: store i16 0, i16* %uninit, align 2, !annotation [[AUTO_INIT]]
+// ZERO-O1: store i16 0, ptr %uninit, align 2, !annotation [[AUTO_INIT]]
TEST_BRACES(smallpartinit, smallpartinit);
// CHECK-LABEL: @test_smallpartinit_braces()
// CHECK: %braces = alloca %struct.smallpartinit, align [[ALIGN:[0-9]*]]
-// CHECK-NEXT: %[[C:[^ ]*]] = getelementptr inbounds %struct.smallpartinit, %struct.smallpartinit* %braces, i32 0, i32 0
-// CHECK-NEXT: store i8 42, i8* %[[C]], align [[ALIGN]]
+// CHECK-NEXT: %[[C:[^ ]*]] = getelementptr inbounds %struct.smallpartinit, ptr %braces, i32 0, i32 0
+// CHECK-NEXT: store i8 42, ptr %[[C]], align [[ALIGN]]
// CHECK-NOT: !annotation
-// CHECK-NEXT: %[[D:[^ ]*]] = getelementptr inbounds %struct.smallpartinit, %struct.smallpartinit* %braces, i32 0, i32 1
-// CHECK-NEXT: store i8 0, i8* %[[D]], align [[ALIGN]]
+// CHECK-NEXT: %[[D:[^ ]*]] = getelementptr inbounds %struct.smallpartinit, ptr %braces, i32 0, i32 1
+// CHECK-NEXT: store i8 0, ptr %[[D]], align [[ALIGN]]
// CHECK-NOT: !annotation
// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)
TEST_CUSTOM(smallpartinit, smallpartinit, { 100, 42 });
// CHECK-LABEL: @test_smallpartinit_custom()
// CHECK: %custom = alloca %struct.smallpartinit, align [[ALIGN:[0-9]*]]
-// CHECK-NEXT: %[[C:[^ ]*]] = getelementptr inbounds %struct.smallpartinit, %struct.smallpartinit* %custom, i32 0, i32 0
-// CHECK-NEXT: store i8 100, i8* %[[C]], align [[ALIGN]]
+// CHECK-NEXT: %[[C:[^ ]*]] = getelementptr inbounds %struct.smallpartinit, ptr %custom, i32 0, i32 0
+// CHECK-NEXT: store i8 100, ptr %[[C]], align [[ALIGN]]
// CHECK-NOT: !annotation
-// CHECK-NEXT: %[[D:[^ ]*]] = getelementptr inbounds %struct.smallpartinit, %struct.smallpartinit* %custom, i32 0, i32 1
-// CHECK-NEXT: store i8 42, i8* %[[D]], align [[ALIGN]]
+// CHECK-NEXT: %[[D:[^ ]*]] = getelementptr inbounds %struct.smallpartinit, ptr %custom, i32 0, i32 1
+// CHECK-NEXT: store i8 42, ptr %[[D]], align [[ALIGN]]
// CHECK-NOT: !annotation
// CHECK-NEXT: call void @{{.*}}used{{.*}}%custom)
@@ -698,16 +695,16 @@ TEST_UNINIT(nullinit, nullinit);
TEST_BRACES(nullinit, nullinit);
// CHECK-LABEL: @test_nullinit_braces()
// CHECK: %braces = alloca %struct.nullinit, align [[ALIGN:[0-9]*]]
-// CHECK-NEXT: %[[N:[^ ]*]] = getelementptr inbounds %struct.nullinit, %struct.nullinit* %braces, i32 0, i32 0
-// CHECK-NEXT: store i8* null, i8** %[[N]], align [[ALIGN]]
+// CHECK-NEXT: %[[N:[^ ]*]] = getelementptr inbounds %struct.nullinit, ptr %braces, i32 0, i32 0
+// CHECK-NEXT: store ptr null, ptr %[[N]], align [[ALIGN]]
// CHECK-NOT: !annotation
// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)
TEST_CUSTOM(nullinit, nullinit, { (char*)"derp" });
// CHECK-LABEL: @test_nullinit_custom()
// CHECK: %custom = alloca %struct.nullinit, align [[ALIGN:[0-9]*]]
-// CHECK-NEXT: %[[N:[^ ]*]] = getelementptr inbounds %struct.nullinit, %struct.nullinit* %custom, i32 0, i32 0
-// CHECK-NEXT: store i8* getelementptr inbounds {{.*}}, i8** %[[N]], align [[ALIGN]]
+// CHECK-NEXT: %[[N:[^ ]*]] = getelementptr inbounds %struct.nullinit, ptr %custom, i32 0, i32 0
+// CHECK-NEXT: store ptr {{.*}}, ptr %[[N]], align [[ALIGN]]
// CHECK-NOT: !annotation
// CHECK-NEXT: call void @{{.*}}used{{.*}}%custom)
@@ -717,23 +714,21 @@ TEST_UNINIT(padded, padded);
// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)
// PATTERN-LABEL: @test_padded_uninit()
// PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_padded_uninit.uninit{{.+}}), !annotation [[AUTO_INIT]]
-// PATTERN-O1: store i64 [[I64]], i64* %uninit, align 8, !annotation [[AUTO_INIT]]
+// PATTERN-O1: store i64 [[I64]], ptr %uninit, align 8, !annotation [[AUTO_INIT]]
// ZERO-LABEL: @test_padded_uninit()
// ZERO-O0: call void @llvm.memset{{.*}}, i8 0,{{.+}}), !annotation [[AUTO_INIT]]
-// ZERO-O1: store i64 0, i64* %uninit, align 8, !annotation [[AUTO_INIT]]
+// ZERO-O1: store i64 0, ptr %uninit, align 8, !annotation [[AUTO_INIT]]
TEST_BRACES(padded, padded);
// CHECK-LABEL: @test_padded_braces()
// CHECK: %braces = alloca %struct.padded, align [[ALIGN:[0-9]*]]
-// CHECK-NEXT: bitcast
-// CHECK-NEXT: call void @llvm.memset{{.*}}(i8* align [[ALIGN]] %{{.*}}, i8 0, i64 8, i1 false)
+// CHECK-NEXT: call void @llvm.memset{{.*}}(ptr align [[ALIGN]] %{{.*}}, i8 0, i64 8, i1 false)
// CHECK-NOT: !annotation
// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)
TEST_CUSTOM(padded, padded, { 42, 13371337 });
// CHECK-LABEL: @test_padded_custom()
// CHECK: %custom = alloca %struct.padded, align
-// CHECK-NEXT: bitcast
// CHECK-NEXT: call void @llvm.memcpy
// CHECK-NOT: !annotation
// CHECK-NEXT: call void @{{.*}}used{{.*}}%custom)
@@ -745,10 +740,10 @@ TEST_UNINIT(paddednullinit, paddednullinit);
// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)
// PATTERN-LABEL: @test_paddednullinit_uninit()
// PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_paddednullinit_uninit.uninit{{.+}}), !annotation [[AUTO_INIT]]
-// PATTERN-O1: store i64 [[I64]], i64* %uninit, align 8, !annotation [[AUTO_INIT]]
+// PATTERN-O1: store i64 [[I64]], ptr %uninit, align 8, !annotation [[AUTO_INIT]]
// ZERO-LABEL: @test_paddednullinit_uninit()
// ZERO-O0: call void @llvm.memset{{.*}}, i8 0, {{.*}}, !annotation [[AUTO_INIT]]
-// ZERO-O1: store i64 0, i64* %uninit, align 8
+// ZERO-O1: store i64 0, ptr %uninit, align 8
// FIXME: !annotation dropped by optimizations
// ZERO-O1-NOT: !annotation
// ZERO: ret
@@ -757,22 +752,22 @@ TEST_UNINIT(paddednullinit, paddednullinit);
TEST_BRACES(paddednullinit, paddednullinit);
// CHECK-LABEL: @test_paddednullinit_braces()
// CHECK: %braces = alloca %struct.paddednullinit, align [[ALIGN:[0-9]*]]
-// CHECK-NEXT: %[[C:[^ ]*]] = getelementptr inbounds %struct.paddednullinit, %struct.paddednullinit* %braces, i32 0, i32 0
-// CHECK-NEXT: store i8 0, i8* %[[C]], align [[ALIGN]]
+// CHECK-NEXT: %[[C:[^ ]*]] = getelementptr inbounds %struct.paddednullinit, ptr %braces, i32 0, i32 0
+// CHECK-NEXT: store i8 0, ptr %[[C]], align [[ALIGN]]
// CHECK-NOT: !annotation
-// CHECK-NEXT: %[[I:[^ ]*]] = getelementptr inbounds %struct.paddednullinit, %struct.paddednullinit* %braces, i32 0, i32 1
-// CHECK-NEXT: store i32 0, i32* %[[I]], align [[ALIGN]]
+// CHECK-NEXT: %[[I:[^ ]*]] = getelementptr inbounds %struct.paddednullinit, ptr %braces, i32 0, i32 1
+// CHECK-NEXT: store i32 0, ptr %[[I]], align [[ALIGN]]
// CHECK-NOT: !annotation
// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)
TEST_CUSTOM(paddednullinit, paddednullinit, { 42, 13371337 });
// CHECK-LABEL: @test_paddednullinit_custom()
// CHECK: %custom = alloca %struct.paddednullinit, align [[ALIGN:[0-9]*]]
-// CHECK-NEXT: %[[C:[^ ]*]] = getelementptr inbounds %struct.paddednullinit, %struct.paddednullinit* %custom, i32 0, i32 0
-// CHECK-NEXT: store i8 42, i8* %[[C]], align [[ALIGN]]
+// CHECK-NEXT: %[[C:[^ ]*]] = getelementptr inbounds %struct.paddednullinit, ptr %custom, i32 0, i32 0
+// CHECK-NEXT: store i8 42, ptr %[[C]], align [[ALIGN]]
// CHECK-NOT: !annotation
-// CHECK-NEXT: %[[I:[^ ]*]] = getelementptr inbounds %struct.paddednullinit, %struct.paddednullinit* %custom, i32 0, i32 1
-// CHECK-NEXT: store i32 13371337, i32* %[[I]], align [[ALIGN]]
+// CHECK-NEXT: %[[I:[^ ]*]] = getelementptr inbounds %struct.paddednullinit, ptr %custom, i32 0, i32 1
+// CHECK-NEXT: store i32 13371337, ptr %[[I]], align [[ALIGN]]
// CHECK-NOT: !annotation
// CHECK-NEXT: call void @{{.*}}used{{.*}}%custom)
@@ -782,10 +777,9 @@ TEST_UNINIT(paddedpacked, paddedpacked);
// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)
// PATTERN-LABEL: @test_paddedpacked_uninit()
// PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_paddedpacked_uninit.uninit{{.+}}), !annotation [[AUTO_INIT]]
-// PATTERN-O1: %[[C:[^ ]*]] = getelementptr inbounds {{.*}}%uninit, i64 0, i32 0
-// PATTERN-O1: store i8 [[I8]], i8* %[[C]], align {{.+}}, !annotation [[AUTO_INIT]]
+// PATTERN-O1: store i8 [[I8]], ptr %uninit, align {{.+}}, !annotation [[AUTO_INIT]]
// PATTERN-O1: %[[I:[^ ]*]] = getelementptr inbounds {{.*}}%uninit, i64 0, i32 1
-// PATTERN-O1: store i32 [[I32]], i32* %[[I]], align {{.+}}, !annotation [[AUTO_INIT]]
+// PATTERN-O1: store i32 [[I32]], ptr %[[I]], align {{.+}}, !annotation [[AUTO_INIT]]
// ZERO-LABEL: @test_paddedpacked_uninit()
// ZERO: call void @llvm.memset{{.*}}, i8 0,{{.+}}), !annotation [[AUTO_INIT]]
@@ -793,15 +787,13 @@ TEST_UNINIT(paddedpacked, paddedpacked);
TEST_BRACES(paddedpacked, paddedpacked);
// CHECK-LABEL: @test_paddedpacked_braces()
// CHECK: %braces = alloca %struct.paddedpacked, align [[ALIGN:[0-9]*]]
-// CHECK-NEXT: bitcast
-// CHECK-NEXT: call void @llvm.memset{{.*}}(i8* align [[ALIGN]] %{{.*}}, i8 0, i64 5, i1 false)
+// CHECK-NEXT: call void @llvm.memset{{.*}}(ptr align [[ALIGN]] %{{.*}}, i8 0, i64 5, i1 false)
// CHECK-NOT: !annotation
// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)
TEST_CUSTOM(paddedpacked, paddedpacked, { 42, 13371337 });
// CHECK-LABEL: @test_paddedpacked_custom()
// CHECK: %custom = alloca %struct.paddedpacked, align
-// CHECK-NEXT: bitcast
// CHECK-NEXT: call void @llvm.memcpy{{.*}}({{.*}}@__const.test_paddedpacked_custom.custom
// CHECK-NOT: !annotation
// CHECK-NEXT: call void @{{.*}}used{{.*}}%custom)
@@ -812,7 +804,6 @@ TEST_UNINIT(paddedpackedarray, paddedpackedarray);
// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)
// PATTERN-LABEL: @test_paddedpackedarray_uninit()
// PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_paddedpackedarray_uninit.uninit{{.+}}), !annotation [[AUTO_INIT]]
-// PATTERN-O1: getelementptr
// PATTERN-O1: call void @llvm.memset{{.*}}({{.*}}i8 [[I8]], i64 10
// FIXME: !annotation dropped by optimizations
// PATTERN-O1-NOT: !annotation
@@ -822,15 +813,13 @@ TEST_UNINIT(paddedpackedarray, paddedpackedarray);
TEST_BRACES(paddedpackedarray, paddedpackedarray);
// CHECK-LABEL: @test_paddedpackedarray_braces()
// CHECK: %braces = alloca %struct.paddedpackedarray, align [[ALIGN:[0-9]*]]
-// CHECK-NEXT: bitcast
-// CHECK-NEXT: call void @llvm.memset{{.*}}(i8* align [[ALIGN]] %{{.*}}, i8 0, i64 10, i1 false)
+// CHECK-NEXT: call void @llvm.memset{{.*}}(ptr align [[ALIGN]] %{{.*}}, i8 0, i64 10, i1 false)
// CHECK-NOT: !annotation
// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)
TEST_CUSTOM(paddedpackedarray, paddedpackedarray, { {{ 42, 13371337 }, { 43, 13371338 }} });
// CHECK-LABEL: @test_paddedpackedarray_custom()
// CHECK: %custom = alloca %struct.paddedpackedarray, align
-// CHECK-NEXT: bitcast
// CHECK-NEXT: call void @llvm.memcpy{{.*}}({{.*}}@__const.test_paddedpackedarray_custom.custom
// CHECK-NOT: !annotation
// CHECK-NEXT: call void @{{.*}}used{{.*}}%custom)
@@ -845,7 +834,6 @@ TEST_UNINIT(paddednested, paddednested);
// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)
// PATTERN-LABEL: @test_paddednested_uninit()
// PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_paddednested_uninit.uninit{{.+}}), !annotation [[AUTO_INIT]]
-// PATTERN-O1: getelementptr
// PATTERN-O1: call void @llvm.memset{{.*}}({{.*}}, i8 [[I8]], i64 16{{.+}})
// FIXME: !annotation dropped by optimizations
// PATTERN-O1-NOT: !annotation
@@ -855,15 +843,13 @@ TEST_UNINIT(paddednested, paddednested);
TEST_BRACES(paddednested, paddednested);
// CHECK-LABEL: @test_paddednested_braces()
// CHECK: %braces = alloca %struct.paddednested, align [[ALIGN:[0-9]*]]
-// CHECK-NEXT: bitcast
-// CHECK-NEXT: call void @llvm.memset{{.*}}(i8* align [[ALIGN]] %{{.*}}, i8 0, i64 16, i1 false)
+// CHECK-NEXT: call void @llvm.memset{{.*}}(ptr align [[ALIGN]] %{{.*}}, i8 0, i64 16, i1 false)
// CHECK-NOT: !annotation
// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)
TEST_CUSTOM(paddednested, paddednested, { { 42, 13371337 }, { 43, 13371338 } });
// CHECK-LABEL: @test_paddednested_custom()
// CHECK: %custom = alloca %struct.paddednested, align
-// CHECK-NEXT: bitcast
// CHECK-NEXT: call void @llvm.memcpy{{.*}}({{.*}}@__const.test_paddednested_custom.custom
// CHECK-NOT: !annotation
// CHECK-NEXT: call void @{{.*}}used{{.*}}%custom)
@@ -874,8 +860,7 @@ TEST_UNINIT(paddedpackednested, paddedpackednested);
// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)
// PATTERN-LABEL: @test_paddedpackednested_uninit()
// PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_paddedpackednested_uninit.uninit{{.+}}), !annotation [[AUTO_INIT]]
-// PATTERN-O1: getelementptr
-// PATTERN-O1: call void @llvm.memset.p0i8.i64(i8* noundef nonnull align 1 dereferenceable(10) %0, i8 [[I8]], i64 10, i1 false)
+// PATTERN-O1: call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %uninit, i8 [[I8]], i64 10, i1 false)
// FIXME: !annotation dropped by optimizations
// PATTERN-O1-NOT: !annotation
// ZERO-LABEL: @test_paddedpackednested_uninit()
@@ -884,15 +869,13 @@ TEST_UNINIT(paddedpackednested, paddedpackednested);
TEST_BRACES(paddedpackednested, paddedpackednested);
// CHECK-LABEL: @test_paddedpackednested_braces()
// CHECK: %braces = alloca %struct.paddedpackednested, align [[ALIGN:[0-9]*]]
-// CHECK-NEXT: bitcast
-// CHECK-NEXT: call void @llvm.memset{{.*}}(i8* align [[ALIGN]] %{{.*}}, i8 0, i64 10, i1 false)
+// CHECK-NEXT: call void @llvm.memset{{.*}}(ptr align [[ALIGN]] %{{.*}}, i8 0, i64 10, i1 false)
// CHECK-NOT: !annotation
// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)
TEST_CUSTOM(paddedpackednested, paddedpackednested, { { 42, 13371337 }, { 43, 13371338 } });
// CHECK-LABEL: @test_paddedpackednested_custom()
// CHECK: %custom = alloca %struct.paddedpackednested, align
-// CHECK-NEXT: bitcast
// CHECK-NEXT: call void @llvm.memcpy{{.*}}({{.*}}@__const.test_paddedpackednested_custom.custom
// CHECK-NOT: !annotation
// CHECK-NEXT: call void @{{.*}}used{{.*}}%custom)
@@ -903,17 +886,16 @@ TEST_UNINIT(bitfield, bitfield);
// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)
// PATTERN-LABEL: @test_bitfield_uninit()
// PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_bitfield_uninit.uninit{{.+}}), !annotation [[AUTO_INIT]]
-// PATTERN-O1: store i32 [[I32]], i32* %uninit, align 4
+// PATTERN-O1: store i32 [[I32]], ptr %uninit, align 4
// FIXME: !annotation dropped by optimizations
// PATTERN-O1-NOT: !annotation
// ZERO-LABEL: @test_bitfield_uninit()
// ZERO-O0: call void @llvm.memset{{.*}}, i8 0{{.+}}), !annotation [[AUTO_INIT]]
-// ZERO-O1: store i32 0, i32* %uninit, align 4, !annotation [[AUTO_INIT]]
+// ZERO-O1: store i32 0, ptr %uninit, align 4, !annotation [[AUTO_INIT]]
TEST_BRACES(bitfield, bitfield);
// CHECK-LABEL: @test_bitfield_braces()
// CHECK: %braces = alloca %struct.bitfield, align
-// CHECK-NEXT: bitcast
// CHECK-NEXT: call void @llvm.memcpy
// CHECK-NOT: !annotation
// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)
@@ -921,7 +903,6 @@ TEST_BRACES(bitfield, bitfield);
TEST_CUSTOM(bitfield, bitfield, { 4, 1 });
// CHECK-LABEL: @test_bitfield_custom()
// CHECK: %custom = alloca %struct.bitfield, align
-// CHECK-NEXT: bitcast
// CHECK-NEXT: call void @llvm.memcpy
// CHECK-NOT: !annotation
// CHECK-NEXT: call void @{{.*}}used{{.*}}%custom)
@@ -932,17 +913,16 @@ TEST_UNINIT(bitfieldaligned, bitfieldaligned);
// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)
// PATTERN-LABEL: @test_bitfieldaligned_uninit()
// PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_bitfieldaligned_uninit.uninit{{.+}}), !annotation [[AUTO_INIT]]
-// PATTERN-O1: store i64 [[IPTR]], i64* %uninit, align 8
+// PATTERN-O1: store i64 [[IPTR]], ptr %uninit, align 8
// FIXME: !annotation dropped by optimizations
// PATTERN-O1-NOT: !annotation
// ZERO-LABEL: @test_bitfieldaligned_uninit()
// ZERO-O0: call void @llvm.memset{{.*}}, i8 0,{{.+}}), !annotation [[AUTO_INIT]]
-// ZERO-O1: store i64 0, i64* %uninit, align 8, !annotation [[AUTO_INIT]]
+// ZERO-O1: store i64 0, ptr %uninit, align 8, !annotation [[AUTO_INIT]]
TEST_BRACES(bitfieldaligned, bitfieldaligned);
// CHECK-LABEL: @test_bitfieldaligned_braces()
// CHECK: %braces = alloca %struct.bitfieldaligned, align
-// CHECK-NEXT: bitcast
// CHECK-NEXT: call void @llvm.memcpy
// CHECK-NOT: !annotation
// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)
@@ -950,7 +930,6 @@ TEST_BRACES(bitfieldaligned, bitfieldaligned);
TEST_CUSTOM(bitfieldaligned, bitfieldaligned, { 4, 1 });
// CHECK-LABEL: @test_bitfieldaligned_custom()
// CHECK: %custom = alloca %struct.bitfieldaligned, align
-// CHECK-NEXT: bitcast
// CHECK-NEXT: call void @llvm.memcpy
// CHECK-NOT: !annotation
// CHECK-NEXT: call void @{{.*}}used{{.*}}%custom)
@@ -967,16 +946,14 @@ TEST_UNINIT(big, big);
TEST_BRACES(big, big);
// CHECK-LABEL: @test_big_braces()
// CHECK: %braces = alloca %struct.big, align [[ALIGN:[0-9]*]]
-// CHECK-NEXT: bitcast
-// CHECK-NEXT: call void @llvm.memset{{.*}}(i8* align [[ALIGN]] %{{.*}}, i8 0, i64 104, i1 false)
+// CHECK-NEXT: call void @llvm.memset{{.*}}(ptr align [[ALIGN]] %{{.*}}, i8 0, i64 104, i1 false)
// CHECK-NOT: !annotation
// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)
TEST_CUSTOM(big, big, { 0xAAAAAAAA, 0xAAAAAAAA, 0xAAAAAAAA, 0xAAAAAAAA, 0xAAAAAAAA, 0xAAAAAAAA, 0xAAAAAAAA, 0xAAAAAAAA, 0xAAAAAAAA, 0xAAAAAAAA, 0xAAAAAAAA, 0xAAAAAAAA, 0xAAAAAAAA, 0xAAAAAAAA, 0xAAAAAAAA, 0xAAAAAAAA, 0xAAAAAAAA, 0xAAAAAAAA, 0xAAAAAAAA, 0xAAAAAAAA, 0xAAAAAAAA, 0xAAAAAAAA, 0xAAAAAAAA, 0xAAAAAAAA, 0xAAAAAAAA, 0xAAAAAAAA });
// CHECK-LABEL: @test_big_custom()
// CHECK: %custom = alloca %struct.big, align [[ALIGN:[0-9]*]]
-// CHECK-NEXT: bitcast
-// CHECK-NEXT: call void @llvm.memset{{.*}}(i8* align [[ALIGN]] %{{.*}}, i8 -86, i64 104, i1 false)
+// CHECK-NEXT: call void @llvm.memset{{.*}}(ptr align [[ALIGN]] %{{.*}}, i8 -86, i64 104, i1 false)
// CHECK-NOT: !annotation
// CHECK-NEXT: call void @{{.*}}used{{.*}}%custom)
@@ -994,15 +971,13 @@ TEST_UNINIT(arraytail, arraytail);
TEST_BRACES(arraytail, arraytail);
// CHECK-LABEL: @test_arraytail_braces()
// CHECK: %braces = alloca %struct.arraytail, align [[ALIGN:[0-9]*]]
-// CHECK-NEXT: bitcast
-// CHECK-NEXT: call void @llvm.memset{{.*}}(i8* align [[ALIGN]] %{{.*}}, i8 0, i64 4, i1 false)
+// CHECK-NEXT: call void @llvm.memset{{.*}}(ptr align [[ALIGN]] %{{.*}}, i8 0, i64 4, i1 false)
// CHECK-NOT: !annotation
// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)
TEST_CUSTOM(arraytail, arraytail, { 0xdead });
// CHECK-LABEL: @test_arraytail_custom()
// CHECK: %custom = alloca %struct.arraytail, align
-// CHECK-NEXT: bitcast
// CHECK-NEXT: call void @llvm.memcpy
// CHECK-NOT: !annotation
// CHECK-NEXT: call void @{{.*}}used{{.*}}%custom)
@@ -1021,7 +996,6 @@ TEST_UNINIT(int0, int[0]);
TEST_BRACES(int0, int[0]);
// CHECK-LABEL: @test_int0_braces()
// CHECK: %braces = alloca [0 x i32], align [[ALIGN:[0-9]*]]
-// CHECK-NEXT: bitcast
// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)
TEST_UNINIT(int1, int[1]);
@@ -1038,15 +1012,13 @@ TEST_UNINIT(int1, int[1]);
TEST_BRACES(int1, int[1]);
// CHECK-LABEL: @test_int1_braces()
// CHECK: %braces = alloca [1 x i32], align [[ALIGN:[0-9]*]]
-// CHECK-NEXT: bitcast
-// CHECK-NEXT: call void @llvm.memset{{.*}}(i8* align [[ALIGN]] %{{.*}}, i8 0, i64 4, i1 false)
+// CHECK-NEXT: call void @llvm.memset{{.*}}(ptr align [[ALIGN]] %{{.*}}, i8 0, i64 4, i1 false)
// CHECK-NOT: !annotation
// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)
TEST_CUSTOM(int1, int[1], { 0x33333333 });
// CHECK-LABEL: @test_int1_custom()
// CHECK: %custom = alloca [1 x i32], align
-// CHECK-NEXT: bitcast
// CHECK-NEXT: call void @llvm.memcpy
// CHECK-NOT: !annotation
// CHECK-NEXT: call void @{{.*}}used{{.*}}%custom)
@@ -1063,16 +1035,14 @@ TEST_UNINIT(int64, int[64]);
TEST_BRACES(int64, int[64]);
// CHECK-LABEL: @test_int64_braces()
// CHECK: %braces = alloca [64 x i32], align [[ALIGN:[0-9]*]]
-// CHECK-NEXT: bitcast
-// CHECK-NEXT: call void @llvm.memset{{.*}}(i8* align [[ALIGN]] %{{.*}}, i8 0, i64 256, i1 false)
+// CHECK-NEXT: call void @llvm.memset{{.*}}(ptr align [[ALIGN]] %{{.*}}, i8 0, i64 256, i1 false)
// CHECK-NOT: !annotation
// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)
TEST_CUSTOM(int64, int[64], = { 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111 });
// CHECK-LABEL: @test_int64_custom()
// CHECK: %custom = alloca [64 x i32], align [[ALIGN:[0-9]*]]
-// CHECK-NEXT: bitcast
-// CHECK-NEXT: call void @llvm.memset{{.*}}(i8* align [[ALIGN]] %{{.*}}, i8 17, i64 256, i1 false)
+// CHECK-NEXT: call void @llvm.memset{{.*}}(ptr align [[ALIGN]] %{{.*}}, i8 17, i64 256, i1 false)
// CHECK-NOT: !annotation
// CHECK-NEXT: call void @{{.*}}used{{.*}}%custom)
@@ -1082,35 +1052,33 @@ TEST_UNINIT(bool4, bool[4]);
// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)
// PATTERN-LABEL: @test_bool4_uninit()
// PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_bool4_uninit.uninit{{.+}}), !annotation [[AUTO_INIT]]
-// PATTERN-O1: store i32 [[I32]], i32* %uninit, align 4
+// PATTERN-O1: store i32 [[I32]], ptr %uninit, align 4
// FIXME: !annotation dropped by optimizations
// PATTERN-O1-NOT: !annotation
// ZERO-LABEL: @test_bool4_uninit()
// ZERO-O0: call void @llvm.memset{{.*}}, i8 0,{{.+}}), !annotation [[AUTO_INIT]]
-// ZERO-O1: store i32 0, i32* %uninit, align 4, !annotation [[AUTO_INIT]]
+// ZERO-O1: store i32 0, ptr %uninit, align 4, !annotation [[AUTO_INIT]]
TEST_BRACES(bool4, bool[4]);
// CHECK-LABEL: @test_bool4_braces()
// CHECK: %braces = alloca [4 x i8], align [[ALIGN:[0-9]*]]
-// CHECK-NEXT: bitcast
-// CHECK-NEXT: call void @llvm.memset{{.*}}(i8* align [[ALIGN]] %{{.*}}, i8 0, i64 4, i1 false)
+// CHECK-NEXT: call void @llvm.memset{{.*}}(ptr align [[ALIGN]] %{{.*}}, i8 0, i64 4, i1 false)
// CHECK-NOT: !annotation
// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)
TEST_CUSTOM(bool4, bool[4], { true, true, true, true });
// CHECK-LABEL: @test_bool4_custom()
// CHECK: %custom = alloca [4 x i8], align
-// CHECK-NEXT: bitcast
// CHECK-NEXT: call void @llvm.memcpy
// CHECK-NOT: !annotation
// CHECK-NEXT: call void @{{.*}}used{{.*}}%custom)
TEST_UNINIT(intptr4, int*[4]);
// CHECK-LABEL: @test_intptr4_uninit()
-// CHECK: %uninit = alloca [4 x i32*], align
+// CHECK: %uninit = alloca [4 x ptr], align
// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)
// PATTERN-O1-LABEL: @test_intptr4_uninit()
-// PATTERN-O1: call void @llvm.memset.p0i8.i64(i8* noundef nonnull align 16 dereferenceable(32) %{{[0-9*]}}, i8 -86, i64 32, i1 false)
+// PATTERN-O1: call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) %{{.*}}, i8 -86, i64 32, i1 false)
// FIXME: !annotation dropped by optimizations
// PATTERN-O1-NOT: !annotation
// ZERO-LABEL: @test_intptr4_uninit()
@@ -1118,16 +1086,14 @@ TEST_UNINIT(intptr4, int*[4]);
TEST_BRACES(intptr4, int*[4]);
// CHECK-LABEL: @test_intptr4_braces()
-// CHECK: %braces = alloca [4 x i32*], align [[ALIGN:[0-9]*]]
-// CHECK-NEXT: bitcast
-// CHECK-NEXT: call void @llvm.memset{{.*}}(i8* align [[ALIGN]] %{{.*}}, i8 0, i64 32, i1 false)
+// CHECK: %braces = alloca [4 x ptr], align [[ALIGN:[0-9]*]]
+// CHECK-NEXT: call void @llvm.memset{{.*}}(ptr align [[ALIGN]] %{{.*}}, i8 0, i64 32, i1 false)
// CHECK-NOT: !annotation
// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)
TEST_CUSTOM(intptr4, int *[4], = {(int *)0x22222222, (int *)0x22222222, (int *)0x22222222, (int *)0x22222222});
// CHECK-LABEL: @test_intptr4_custom()
-// CHECK: %custom = alloca [4 x i32*], align
-// CHECK-NEXT: bitcast
+// CHECK: %custom = alloca [4 x ptr], align
// CHECK-NEXT: call void @llvm.memcpy
// CHECK-NOT: !annotation
// CHECK-NEXT: call void @{{.*}}used{{.*}}%custom)
@@ -1138,8 +1104,7 @@ TEST_UNINIT(tailpad4, tailpad[4]);
// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)
// PATTERN-LABEL: @test_tailpad4_uninit()
// PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_tailpad4_uninit.uninit{{.+}}), !annotation [[AUTO_INIT]]
-// PATTERN-O1: bitcast
-// PATTERN-O1: call void @llvm.memset{{.*}}({{.*}}0, i8 [[I8]], i64 16{{.+}})
+// PATTERN-O1: call void @llvm.memset{{.*}}({{.*}}, i8 [[I8]], i64 16{{.+}})
// FIXME: !annotation dropped by optimizations
// PATTERN-O1-NOT: !annotation
// ZERO-LABEL: @test_tailpad4_uninit()
@@ -1148,15 +1113,13 @@ TEST_UNINIT(tailpad4, tailpad[4]);
TEST_BRACES(tailpad4, tailpad[4]);
// CHECK-LABEL: @test_tailpad4_braces()
// CHECK: %braces = alloca [4 x %struct.tailpad], align [[ALIGN:[0-9]*]]
-// CHECK-NEXT: bitcast
-// CHECK-NEXT: call void @llvm.memset{{.*}}(i8* align [[ALIGN]] %{{.*}}, i8 0, i64 16, i1 false)
+// CHECK-NEXT: call void @llvm.memset{{.*}}(ptr align [[ALIGN]] %{{.*}}, i8 0, i64 16, i1 false)
// CHECK-NOT: !annotation
// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)
TEST_CUSTOM(tailpad4, tailpad[4], { {257, 1}, {257, 1}, {257, 1}, {257, 1} });
// CHECK-LABEL: @test_tailpad4_custom()
// CHECK: %custom = alloca [4 x %struct.tailpad], align
-// CHECK-NEXT: bitcast
// CHECK-NEXT: call void @llvm.memcpy
// CHECK-NOT: !annotation
// CHECK-NEXT: call void @{{.*}}used{{.*}}%custom)
@@ -1173,16 +1136,14 @@ TEST_UNINIT(tailpad9, tailpad[9]);
TEST_BRACES(tailpad9, tailpad[9]);
// CHECK-LABEL: @test_tailpad9_braces()
// CHECK: %braces = alloca [9 x %struct.tailpad], align [[ALIGN:[0-9]*]]
-// CHECK-NEXT: bitcast
-// CHECK-NEXT: call void @llvm.memset{{.*}}(i8* align [[ALIGN]] %{{.*}}, i8 0, i64 36, i1 false)
+// CHECK-NEXT: call void @llvm.memset{{.*}}(ptr align [[ALIGN]] %{{.*}}, i8 0, i64 36, i1 false)
// CHECK-NOT: !annotation
// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)
TEST_CUSTOM(tailpad9, tailpad[9], { {257, 1}, {257, 1}, {257, 1}, {257, 1}, {257, 1}, {257, 1}, {257, 1}, {257, 1}, {257, 1} });
// CHECK-LABEL: @test_tailpad9_custom()
// CHECK: %custom = alloca [9 x %struct.tailpad], align [[ALIGN:[0-9]*]]
-// CHECK-NEXT: bitcast
-// CHECK-NEXT: call void @llvm.memset{{.*}}(i8* align [[ALIGN]] %{{.*}}, i8 1, i64 36, i1 false)
+// CHECK-NEXT: call void @llvm.memset{{.*}}(ptr align [[ALIGN]] %{{.*}}, i8 1, i64 36, i1 false)
// CHECK-NOT: !annotation
// CHECK-NEXT: call void @{{.*}}used{{.*}}%custom)
@@ -1191,27 +1152,27 @@ TEST_UNINIT(atomicbool, _Atomic(bool));
// CHECK: %uninit = alloca i8, align
// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)
// PATTERN-LABEL: @test_atomicbool_uninit()
-// PATTERN: store i8 [[I8]], i8* %uninit, align 1, !annotation [[AUTO_INIT]]
+// PATTERN: store i8 [[I8]], ptr %uninit, align 1, !annotation [[AUTO_INIT]]
// ZERO-LABEL: @test_atomicbool_uninit()
-// ZERO: store i8 0, i8* %uninit, align 1, !annotation [[AUTO_INIT]]
+// ZERO: store i8 0, ptr %uninit, align 1, !annotation [[AUTO_INIT]]
TEST_UNINIT(atomicint, _Atomic(int));
// CHECK-LABEL: @test_atomicint_uninit()
// CHECK: %uninit = alloca i32, align
// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)
// PATTERN-LABEL: @test_atomicint_uninit()
-// PATTERN: store i32 [[I32]], i32* %uninit, align 4, !annotation [[AUTO_INIT]]
+// PATTERN: store i32 [[I32]], ptr %uninit, align 4, !annotation [[AUTO_INIT]]
// ZERO-LABEL: @test_atomicint_uninit()
-// ZERO: store i32 0, i32* %uninit, align 4, !annotation [[AUTO_INIT]]
+// ZERO: store i32 0, ptr %uninit, align 4, !annotation [[AUTO_INIT]]
TEST_UNINIT(atomicdouble, _Atomic(double));
// CHECK-LABEL: @test_atomicdouble_uninit()
// CHECK: %uninit = alloca double, align
// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)
// PATTERN-LABEL: @test_atomicdouble_uninit()
-// PATTERN: store double 0xFFFFFFFFFFFFFFFF, double* %uninit, align 8, !annotation [[AUTO_INIT]]
+// PATTERN: store double 0xFFFFFFFFFFFFFFFF, ptr %uninit, align 8, !annotation [[AUTO_INIT]]
// ZERO-LABEL: @test_atomicdouble_uninit()
-// ZERO: store double 0.000000e+00, double* %uninit, align 8, !annotation [[AUTO_INIT]]
+// ZERO: store double 0.000000e+00, ptr %uninit, align 8, !annotation [[AUTO_INIT]]
TEST_UNINIT(atomicnotlockfree, _Atomic(notlockfree));
// CHECK-LABEL: @test_atomicnotlockfree_uninit()
@@ -1219,7 +1180,6 @@ TEST_UNINIT(atomicnotlockfree, _Atomic(notlockfree));
// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)
// PATTERN-LABEL: @test_atomicnotlockfree_uninit()
// PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_atomicnotlockfree_uninit.uninit{{.+}}), !annotation [[AUTO_INIT]]
-// PATTERN-O1: bitcast
// PATTERN-O1: call void @llvm.memset{{.*}}({{.*}}, i8 [[I8]], i64 32{{.*}}
// FIXME: !annotation dropped by optimizations
// PATTERN-O1-NOT: !annotation
@@ -1232,10 +1192,10 @@ TEST_UNINIT(atomicpadded, _Atomic(padded));
// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)
// PATTERN-LABEL: @test_atomicpadded_uninit()
// PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_atomicpadded_uninit.uninit{{.+}}), !annotation [[AUTO_INIT]]
-// PATTERN-O1: store i64 [[IPTR]], i64* %uninit, align 8, !annotation [[AUTO_INIT]]
+// PATTERN-O1: store i64 [[IPTR]], ptr %uninit, align 8, !annotation [[AUTO_INIT]]
// ZERO-LABEL: @test_atomicpadded_uninit()
// ZERO-O0: call void @llvm.memset{{.*}}, i8 0, {{.+}}), !annotation [[AUTO_INIT]]
-// ZERO-O1: store i64 0, i64* %uninit, align 8, !annotation [[AUTO_INIT]]
+// ZERO-O1: store i64 0, ptr %uninit, align 8, !annotation [[AUTO_INIT]]
TEST_UNINIT(atomictailpad, _Atomic(tailpad));
// CHECK-LABEL: @test_atomictailpad_uninit()
@@ -1245,7 +1205,7 @@ TEST_UNINIT(atomictailpad, _Atomic(tailpad));
// PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_atomictailpad_uninit.uninit{{.+}}), !annotation [[AUTO_INIT]]
// ZERO-LABEL: @test_atomictailpad_uninit()
// ZERO-O0: call void @llvm.memset{{.*}}, i8 0,{{.+}}), !annotation [[AUTO_INIT]]
-// ZERO-O1: store i32 0, i32* %uninit, align 4, !annotation [[AUTO_INIT]]
+// ZERO-O1: store i32 0, ptr %uninit, align 4, !annotation [[AUTO_INIT]]
TEST_UNINIT(complexfloat, _Complex float);
// CHECK-LABEL: @test_complexfloat_uninit()
@@ -1253,35 +1213,34 @@ TEST_UNINIT(complexfloat, _Complex float);
// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)
// PATTERN-LABEL: @test_complexfloat_uninit()
// PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_complexfloat_uninit.uninit{{.+}}), !annotation [[AUTO_INIT]]
-// PATTERN-O1: %[[F1:[^ ]*]] = getelementptr inbounds {{.*}}%uninit, i64 0, i32 0
-// PATTERN-O1: store float 0xFFFFFFFFE0000000, float* %[[F1]], align {{.+}}, !annotation [[AUTO_INIT]]
+// PATTERN-O1: store float 0xFFFFFFFFE0000000, ptr %uninit, align {{.+}}, !annotation [[AUTO_INIT]]
// PATTERN-O1: %[[F2:[^ ]*]] = getelementptr inbounds {{.*}}%uninit, i64 0, i32 1
-// PATTERN-O1: store float 0xFFFFFFFFE0000000, float* %[[F2]], align {{.+}}, !annotation [[AUTO_INIT]]
+// PATTERN-O1: store float 0xFFFFFFFFE0000000, ptr %[[F2]], align {{.+}}, !annotation [[AUTO_INIT]]
// ZERO-LABEL: @test_complexfloat_uninit()
// ZERO-O0: call void @llvm.memset{{.*}}, i8 0, {{.+}}), !annotation [[AUTO_INIT]]
-// ZERO-O1: store i64 0, i64* %uninit, align 8, !annotation [[AUTO_INIT]]
+// ZERO-O1: store i64 0, ptr %uninit, align 8, !annotation [[AUTO_INIT]]
TEST_BRACES(complexfloat, _Complex float);
// CHECK-LABEL: @test_complexfloat_braces()
// CHECK: %braces = alloca { float, float }, align [[ALIGN:[0-9]*]]
-// CHECK-NEXT: %[[R:[^ ]*]] = getelementptr inbounds { float, float }, { float, float }* %braces, i32 0, i32 0
-// CHECK-NEXT: %[[I:[^ ]*]] = getelementptr inbounds { float, float }, { float, float }* %braces, i32 0, i32 1
-// CHECK-NEXT: store float 0.000000e+00, float* %[[R]], align [[ALIGN]]
+// CHECK-NEXT: %[[R:[^ ]*]] = getelementptr inbounds { float, float }, ptr %braces, i32 0, i32 0
+// CHECK-NEXT: %[[I:[^ ]*]] = getelementptr inbounds { float, float }, ptr %braces, i32 0, i32 1
+// CHECK-NEXT: store float 0.000000e+00, ptr %[[R]], align [[ALIGN]]
// CHECK-NOT: !annotation
-// CHECK-NEXT: store float 0.000000e+00, float* %[[I]], align [[ALIGN]]
+// CHECK-NEXT: store float 0.000000e+00, ptr %[[I]], align [[ALIGN]]
// CHECK-NOT: !annotation
// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)
TEST_CUSTOM(complexfloat, _Complex float, { 3.1415926535897932384626433, 3.1415926535897932384626433 });
// CHECK-LABEL: @test_complexfloat_custom()
// CHECK: %custom = alloca { float, float }, align [[ALIGN:[0-9]*]]
-// CHECK-NEXT: %[[R:[^ ]*]] = getelementptr inbounds { float, float }, { float, float }* %custom, i32 0, i32 0
-// CHECK-NEXT: %[[I:[^ ]*]] = getelementptr inbounds { float, float }, { float, float }* %custom, i32 0, i32 1
-// CHECK-NEXT: store float 0x400921FB60000000, float* %[[R]], align [[ALIGN]]
+// CHECK-NEXT: %[[R:[^ ]*]] = getelementptr inbounds { float, float }, ptr %custom, i32 0, i32 0
+// CHECK-NEXT: %[[I:[^ ]*]] = getelementptr inbounds { float, float }, ptr %custom, i32 0, i32 1
+// CHECK-NEXT: store float 0x400921FB60000000, ptr %[[R]], align [[ALIGN]]
// CHECK-NOT: !annotation
-// CHECK-NEXT: store float 0x400921FB60000000, float* %[[I]], align [[ALIGN]]
+// CHECK-NEXT: store float 0x400921FB60000000, ptr %[[I]], align [[ALIGN]]
// CHECK-NOT: !annotation
// CHECK-NEXT: call void @{{.*}}used{{.*}}%custom)
@@ -1297,22 +1256,22 @@ TEST_UNINIT(complexdouble, _Complex double);
TEST_BRACES(complexdouble, _Complex double);
// CHECK-LABEL: @test_complexdouble_braces()
// CHECK: %braces = alloca { double, double }, align [[ALIGN:[0-9]*]]
-// CHECK-NEXT: %[[R:[^ ]*]] = getelementptr inbounds { double, double }, { double, double }* %braces, i32 0, i32 0
-// CHECK-NEXT: %[[I:[^ ]*]] = getelementptr inbounds { double, double }, { double, double }* %braces, i32 0, i32 1
-// CHECK-NEXT: store double 0.000000e+00, double* %[[R]], align [[ALIGN]]
+// CHECK-NEXT: %[[R:[^ ]*]] = getelementptr inbounds { double, double }, ptr %braces, i32 0, i32 0
+// CHECK-NEXT: %[[I:[^ ]*]] = getelementptr inbounds { double, double }, ptr %braces, i32 0, i32 1
+// CHECK-NEXT: store double 0.000000e+00, ptr %[[R]], align [[ALIGN]]
// CHECK-NOT: !annotation
-// CHECK-NEXT: store double 0.000000e+00, double* %[[I]], align [[ALIGN]]
+// CHECK-NEXT: store double 0.000000e+00, ptr %[[I]], align [[ALIGN]]
// CHECK-NOT: !annotation
// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)
TEST_CUSTOM(complexdouble, _Complex double, { 3.1415926535897932384626433, 3.1415926535897932384626433 });
// CHECK-LABEL: @test_complexdouble_custom()
// CHECK: %custom = alloca { double, double }, align [[ALIGN:[0-9]*]]
-// CHECK-NEXT: %[[R:[^ ]*]] = getelementptr inbounds { double, double }, { double, double }* %custom, i32 0, i32 0
-// CHECK-NEXT: %[[I:[^ ]*]] = getelementptr inbounds { double, double }, { double, double }* %custom, i32 0, i32 1
-// CHECK-NEXT: store double 0x400921FB54442D18, double* %[[R]], align [[ALIGN]]
+// CHECK-NEXT: %[[R:[^ ]*]] = getelementptr inbounds { double, double }, ptr %custom, i32 0, i32 0
+// CHECK-NEXT: %[[I:[^ ]*]] = getelementptr inbounds { double, double }, ptr %custom, i32 0, i32 1
+// CHECK-NEXT: store double 0x400921FB54442D18, ptr %[[R]], align [[ALIGN]]
// CHECK-NOT: !annotation
-// CHECK-NEXT: store double 0x400921FB54442D18, double* %[[I]], align [[ALIGN]]
+// CHECK-NEXT: store double 0x400921FB54442D18, ptr %[[I]], align [[ALIGN]]
// CHECK-NOT: !annotation
// CHECK-NEXT: call void @{{.*}}used{{.*}}%custom)
@@ -1321,14 +1280,14 @@ TEST_UNINIT(volatileint, volatile int);
// CHECK: %uninit = alloca i32, align
// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)
// PATTERN-LABEL: @test_volatileint_uninit()
-// PATTERN: store volatile i32 [[I32]], i32* %uninit, align 4, !annotation [[AUTO_INIT]]
+// PATTERN: store volatile i32 [[I32]], ptr %uninit, align 4, !annotation [[AUTO_INIT]]
// ZERO-LABEL: @test_volatileint_uninit()
-// ZERO: store volatile i32 0, i32* %uninit, align 4, !annotation [[AUTO_INIT]]
+// ZERO: store volatile i32 0, ptr %uninit, align 4, !annotation [[AUTO_INIT]]
TEST_BRACES(volatileint, volatile int);
// CHECK-LABEL: @test_volatileint_braces()
// CHECK: %braces = alloca i32, align [[ALIGN:[0-9]*]]
-// CHECK-NEXT: store volatile i32 0, i32* %braces, align [[ALIGN]]
+// CHECK-NEXT: store volatile i32 0, ptr %braces, align [[ALIGN]]
// CHECK-NOT: !annotation
// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)
@@ -1340,24 +1299,22 @@ TEST_UNINIT(semivolatile, semivolatile);
// PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_semivolatile_uninit.uninit{{.+}}), !annotation [[AUTO_INIT]]
// ZERO-LABEL: @test_semivolatile_uninit()
// ZERO-O0: call void @llvm.memset{{.*}}, i8 0, {{.+}}), !annotation [[AUTO_INIT]]
-// ZERO-O1: store i64 0, i64* %uninit, align 8, !annotation [[AUTO_INIT]]
+// ZERO-O1: store i64 0, ptr %uninit, align 8, !annotation [[AUTO_INIT]]
TEST_BRACES(semivolatile, semivolatile);
// CHECK-LABEL: @test_semivolatile_braces()
// CHECK: %braces = alloca %struct.semivolatile, align [[ALIGN:[0-9]*]]
-// CHECK-NEXT: bitcast
-// CHECK-NEXT: call void @llvm.memset{{.*}}(i8* align [[ALIGN]] %{{.*}}, i8 0, i64 8, i1 false)
+// CHECK-NEXT: call void @llvm.memset{{.*}}(ptr align [[ALIGN]] %{{.*}}, i8 0, i64 8, i1 false)
// CHECK-NOT: !annotation
// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)
TEST_CUSTOM(semivolatile, semivolatile, { 0x44444444, 0x44444444 });
// CHECK-LABEL: @test_semivolatile_custom()
// CHECK: %custom = alloca %struct.semivolatile, align
-// CHECK-O0: bitcast
// CHECK-O0: call void @llvm.memcpy
// CHECK-NOT: !annotation
// CHECK-O0: call void @{{.*}}used{{.*}}%custom)
-// CHECK-O1: store i64 4919131752989213764, i64* %custom, align 8
+// CHECK-O1: store i64 4919131752989213764, ptr %custom, align 8
// CHECK-NOT: !annotation
TEST_UNINIT(semivolatileinit, semivolatileinit);
@@ -1369,22 +1326,22 @@ TEST_UNINIT(semivolatileinit, semivolatileinit);
TEST_BRACES(semivolatileinit, semivolatileinit);
// CHECK-LABEL: @test_semivolatileinit_braces()
// CHECK: %braces = alloca %struct.semivolatileinit, align [[ALIGN:[0-9]*]]
-// CHECK-NEXT: %[[I:[^ ]*]] = getelementptr inbounds %struct.semivolatileinit, %struct.semivolatileinit* %braces, i32 0, i32 0
-// CHECK-NEXT: store i32 286331153, i32* %[[I]], align [[ALIGN]]
+// CHECK-NEXT: %[[I:[^ ]*]] = getelementptr inbounds %struct.semivolatileinit, ptr %braces, i32 0, i32 0
+// CHECK-NEXT: store i32 286331153, ptr %[[I]], align [[ALIGN]]
// CHECK-NOT: !annotation
-// CHECK-NEXT: %[[VI:[^ ]*]] = getelementptr inbounds %struct.semivolatileinit, %struct.semivolatileinit* %braces, i32 0, i32 1
-// CHECK-NEXT: store volatile i32 286331153, i32* %[[VI]], align [[ALIGN]]
+// CHECK-NEXT: %[[VI:[^ ]*]] = getelementptr inbounds %struct.semivolatileinit, ptr %braces, i32 0, i32 1
+// CHECK-NEXT: store volatile i32 286331153, ptr %[[VI]], align [[ALIGN]]
// CHECK-NOT: !annotation
// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)
TEST_CUSTOM(semivolatileinit, semivolatileinit, { 0x44444444, 0x44444444 });
// CHECK-LABEL: @test_semivolatileinit_custom()
// CHECK: %custom = alloca %struct.semivolatileinit, align [[ALIGN:[0-9]*]]
-// CHECK-NEXT: %[[I:[^ ]*]] = getelementptr inbounds %struct.semivolatileinit, %struct.semivolatileinit* %custom, i32 0, i32 0
-// CHECK-NEXT: store i32 1145324612, i32* %[[I]], align [[ALIGN]]
+// CHECK-NEXT: %[[I:[^ ]*]] = getelementptr inbounds %struct.semivolatileinit, ptr %custom, i32 0, i32 0
+// CHECK-NEXT: store i32 1145324612, ptr %[[I]], align [[ALIGN]]
// CHECK-NOT: !annotation
-// CHECK-NEXT: %[[VI:[^ ]*]] = getelementptr inbounds %struct.semivolatileinit, %struct.semivolatileinit* %custom, i32 0, i32 1
-// CHECK-NEXT: store volatile i32 1145324612, i32* %[[VI]], align [[ALIGN]]
+// CHECK-NEXT: %[[VI:[^ ]*]] = getelementptr inbounds %struct.semivolatileinit, ptr %custom, i32 0, i32 1
+// CHECK-NEXT: store volatile i32 1145324612, ptr %[[VI]], align [[ALIGN]]
// CHECK-NOT: !annotation
// CHECK-NEXT: call void @{{.*}}used{{.*}}%custom)
@@ -1397,14 +1354,13 @@ TEST_UNINIT(base, base);
// PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_base_uninit.uninit{{.+}}), !annotation [[AUTO_INIT]]
// ZERO-LABEL: @test_base_uninit()
// ZERO-O0: call void @llvm.memset{{.*}}, i8 0,{{.+}}), !annotation [[AUTO_INIT]]
-// ZERO-O1: store i32 (...)** bitcast (i8** getelementptr inbounds ({ [4 x i8*] }, { [4 x i8*] }* @_ZTV4base, i64 0, inrange i32 0, i64 2) to i32 (...)**), {{.*}}, align 8
+// ZERO-O1: store ptr getelementptr inbounds ({ [4 x ptr] }, ptr @_ZTV4base, i64 0, inrange i32 0, i64 2), {{.*}}, align 8
// ZERO-O1-NOT: !annotation
TEST_BRACES(base, base);
// CHECK-LABEL: @test_base_braces()
// CHECK: %braces = alloca %struct.base, align [[ALIGN:[0-9]*]]
-// CHECK-NEXT: bitcast
-// CHECK-NEXT: call void @llvm.memset{{.*}}(i8* align [[ALIGN]] %{{.*}}, i8 0, i64 8, i1 false)
+// CHECK-NEXT: call void @llvm.memset{{.*}}(ptr align [[ALIGN]] %{{.*}}, i8 0, i64 8, i1 false)
// CHECK-NOT: !annotation
// CHECK-NEXT: call void @{{.*}}base{{.*}}%braces)
// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)
@@ -1419,13 +1375,12 @@ TEST_UNINIT(derived, derived);
// ZERO-LABEL: @test_derived_uninit()
// ZERO-O0: call void @llvm.memset{{.*}}, i8 0, {{.+}}), !annotation [[AUTO_INIT]]
// ZERO-O1: store i64 0, {{.*}} align 8, !annotation [[AUTO_INIT]]
-// ZERO-O1: store i32 (...)** bitcast (i8** getelementptr inbounds ({ [4 x i8*] }, { [4 x i8*] }* @_ZTV7derived, i64 0, inrange i32 0, i64 2) to i32 (...)**), {{.*}} align 8
+// ZERO-O1: store ptr getelementptr inbounds ({ [4 x ptr] }, ptr @_ZTV7derived, i64 0, inrange i32 0, i64 2), {{.*}} align 8
TEST_BRACES(derived, derived);
// CHECK-LABEL: @test_derived_braces()
// CHECK: %braces = alloca %struct.derived, align [[ALIGN:[0-9]*]]
-// CHECK-NEXT: bitcast
-// CHECK-NEXT: call void @llvm.memset{{.*}}(i8* align [[ALIGN]] %{{.*}}, i8 0, i64 8, i1 false)
+// CHECK-NEXT: call void @llvm.memset{{.*}}(ptr align [[ALIGN]] %{{.*}}, i8 0, i64 8, i1 false)
// CHECK-NOT: !annotation
// CHECK-NEXT: call void @{{.*}}derived{{.*}}%braces)
// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)
@@ -1444,8 +1399,7 @@ TEST_UNINIT(virtualderived, virtualderived);
TEST_BRACES(virtualderived, virtualderived);
// CHECK-LABEL: @test_virtualderived_braces()
// CHECK: %braces = alloca %struct.virtualderived, align [[ALIGN:[0-9]*]]
-// CHECK-NEXT: bitcast
-// CHECK-NEXT: call void @llvm.memset{{.*}}(i8* align [[ALIGN]] %{{.*}}, i8 0, i64 16, i1 false)
+// CHECK-NEXT: call void @llvm.memset{{.*}}(ptr align [[ALIGN]] %{{.*}}, i8 0, i64 16, i1 false)
// CHECK-NOT: !annotation
// CHECK-NEXT: call void @{{.*}}virtualderived{{.*}}%braces)
// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)
@@ -1463,20 +1417,17 @@ TEST_UNINIT(matching, matching);
TEST_BRACES(matching, matching);
// CHECK-LABEL: @test_matching_braces()
// CHECK: %braces = alloca %union.matching, align [[ALIGN:[0-9]*]]
-// CHECK-NEXT: bitcast
-// CHECK-NEXT: call void @llvm.memset{{.*}}(i8* align [[ALIGN]] %{{.*}}, i8 0, i64 4, i1 false)
+// CHECK-NEXT: call void @llvm.memset{{.*}}(ptr align [[ALIGN]] %{{.*}}, i8 0, i64 4, i1 false)
// CHECK-NOT: !annotation
// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)
TEST_CUSTOM(matching, matching, { .f = 0xf00f });
// CHECK-LABEL: @test_matching_custom()
// CHECK: %custom = alloca %union.matching, align
-// CHECK-O0: bitcast
// CHECK-O0: call void @llvm.memcpy
// CHECK-NOT: !annotation
// CHECK-O0: call void @{{.*}}used{{.*}}%custom)
-// CHECK-O1: getelementptr
-// CHECK-O1: store i32 1198526208, i32* {{.*}}, align 4
+// CHECK-O1: store i32 1198526208, ptr {{.*}}, align 4
// CHECK-NOT: !annotation
TEST_UNINIT(matchingreverse, matchingreverse);
@@ -1493,19 +1444,17 @@ TEST_UNINIT(matchingreverse, matchingreverse);
TEST_BRACES(matchingreverse, matchingreverse);
// CHECK-LABEL: @test_matchingreverse_braces()
// CHECK: %braces = alloca %union.matchingreverse, align [[ALIGN:[0-9]*]]
-// CHECK-NEXT: bitcast
-// CHECK-NEXT: call void @llvm.memset{{.*}}(i8* align [[ALIGN]] %{{.*}}, i8 0, i64 4, i1 false)
+// CHECK-NEXT: call void @llvm.memset{{.*}}(ptr align [[ALIGN]] %{{.*}}, i8 0, i64 4, i1 false)
// CHECK-NOT: !annotation
// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)
TEST_CUSTOM(matchingreverse, matchingreverse, { .i = 0xf00f });
// CHECK-LABEL: @test_matchingreverse_custom()
// CHECK: %custom = alloca %union.matchingreverse, align
-// CHECK-O0: bitcast
// CHECK-O0: call void @llvm.memcpy
// CHECK-NOT: !annotation
// CHECK-O0: call void @{{.*}}used{{.*}}%custom)
-// CHECK-O1: store i32 61455, i32* %1, align 4
+// CHECK-O1: store i32 61455, ptr %custom, align 4
// CHECK-NOT: !annotation
TEST_UNINIT(unmatched, unmatched);
@@ -1521,7 +1470,6 @@ TEST_UNINIT(unmatched, unmatched);
TEST_BRACES(unmatched, unmatched);
// CHECK-LABEL: @test_unmatched_braces()
// CHECK: %braces = alloca %union.unmatched, align
-// CHECK-NEXT: bitcast
// CHECK-NEXT: call void @llvm.memcpy
// CHECK-NOT: !annotation
// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)
@@ -1529,11 +1477,10 @@ TEST_BRACES(unmatched, unmatched);
TEST_CUSTOM(unmatched, unmatched, { .i = 0x3badbeef });
// CHECK-LABEL: @test_unmatched_custom()
// CHECK: %custom = alloca %union.unmatched, align
-// CHECK-O0: bitcast
// CHECK-O0: call void @llvm.memcpy
// CHECK-NOT: !annotation
// CHECK-O0: call void @{{.*}}used{{.*}}%custom)
-// CHECK-O1: store i32 1001242351, i32* {{.*}}, align 4
+// CHECK-O1: store i32 1001242351, ptr {{.*}}, align 4
// CHECK-NOT: !annotation
TEST_UNINIT(unmatchedreverse, unmatchedreverse);
@@ -1549,20 +1496,18 @@ TEST_UNINIT(unmatchedreverse, unmatchedreverse);
TEST_BRACES(unmatchedreverse, unmatchedreverse);
// CHECK-LABEL: @test_unmatchedreverse_braces()
// CHECK: %braces = alloca %union.unmatchedreverse, align [[ALIGN:[0-9]*]]
-// CHECK-NEXT: bitcast
-// CHECK-NEXT: call void @llvm.memset{{.*}}(i8* align [[ALIGN]] %{{.*}}, i8 0, i64 4, i1 false)
+// CHECK-NEXT: call void @llvm.memset{{.*}}(ptr align [[ALIGN]] %{{.*}}, i8 0, i64 4, i1 false)
// CHECK-NOT: !annotation
// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)
TEST_CUSTOM(unmatchedreverse, unmatchedreverse, { .c = 42 });
// CHECK-LABEL: @test_unmatchedreverse_custom()
// CHECK: %custom = alloca %union.unmatchedreverse, align
-// CHECK-O0: bitcast
// CHECK-O0: call void @llvm.memcpy
// CHECK-NOT: !annotation
// CHECK-O0: call void @{{.*}}used{{.*}}%custom)
-// PATTERN-O1: store i32 -1431655894, i32* {{.*}}, align 4
-// ZERO-O1: store i32 42, i32* {{.*}}, align 4
+// PATTERN-O1: store i32 -1431655894, ptr {{.*}}, align 4
+// ZERO-O1: store i32 42, ptr {{.*}}, align 4
TEST_UNINIT(unmatchedfp, unmatchedfp);
// CHECK-LABEL: @test_unmatchedfp_uninit()
@@ -1577,7 +1522,6 @@ TEST_UNINIT(unmatchedfp, unmatchedfp);
TEST_BRACES(unmatchedfp, unmatchedfp);
// CHECK-LABEL: @test_unmatchedfp_braces()
// CHECK: %braces = alloca %union.unmatchedfp, align
-// CHECK-NEXT: bitcast
// CHECK-NEXT: call void @llvm.memcpy
// CHECK-NOT: !annotation
// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)
@@ -1585,11 +1529,10 @@ TEST_BRACES(unmatchedfp, unmatchedfp);
TEST_CUSTOM(unmatchedfp, unmatchedfp, { .d = 3.1415926535897932384626433 });
// CHECK-LABEL: @test_unmatchedfp_custom()
// CHECK: %custom = alloca %union.unmatchedfp, align
-// CHECK-O0: bitcast
// CHECK-O0: call void @llvm.memcpy
// CHECK-NOT: !annotation
// CHECK-O0: call void @{{.*}}used{{.*}}%custom)
-// CHECK-O1: store i64 4614256656552045848, i64* %1, align 8
+// CHECK-O1: store i64 4614256656552045848, ptr %custom, align 8
// CHECK-NOT: !annotation
TEST_UNINIT(emptyenum, emptyenum);
@@ -1597,22 +1540,22 @@ TEST_UNINIT(emptyenum, emptyenum);
// CHECK: %uninit = alloca i32, align
// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)
// PATTERN-LABEL: @test_emptyenum_uninit()
-// PATTERN: store i32 [[I32]], i32* %uninit, align 4, !annotation [[AUTO_INIT]]
+// PATTERN: store i32 [[I32]], ptr %uninit, align 4, !annotation [[AUTO_INIT]]
// ZERO-LABEL: @test_emptyenum_uninit()
-// ZERO: store i32 0, i32* %uninit, align 4, !annotation [[AUTO_INIT]]
+// ZERO: store i32 0, ptr %uninit, align 4, !annotation [[AUTO_INIT]]
TEST_BRACES(emptyenum, emptyenum);
// CHECK-LABEL: @test_emptyenum_braces()
// CHECK: %braces = alloca i32, align [[ALIGN:[0-9]*]]
// CHECK-NOT: !annotation
-// CHECK-NEXT: store i32 0, i32* %braces, align [[ALIGN]]
+// CHECK-NEXT: store i32 0, ptr %braces, align [[ALIGN]]
// CHECK-NOT: !annotation
// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)
TEST_CUSTOM(emptyenum, emptyenum, { (emptyenum)42 });
// CHECK-LABEL: @test_emptyenum_custom()
// CHECK: %custom = alloca i32, align [[ALIGN:[0-9]*]]
-// CHECK-NEXT: store i32 42, i32* %custom, align [[ALIGN]]
+// CHECK-NEXT: store i32 42, ptr %custom, align [[ALIGN]]
// CHECK-NOT: !annotation
// CHECK-NEXT: call void @{{.*}}used{{.*}}%custom)
@@ -1621,21 +1564,21 @@ TEST_UNINIT(smallenum, smallenum);
// CHECK: %uninit = alloca i32, align
// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)
// PATTERN-LABEL: @test_smallenum_uninit()
-// PATTERN: store i32 [[I32]], i32* %uninit, align 4, !annotation [[AUTO_INIT]]
+// PATTERN: store i32 [[I32]], ptr %uninit, align 4, !annotation [[AUTO_INIT]]
// ZERO-LABEL: @test_smallenum_uninit()
-// ZERO: store i32 0, i32* %uninit, align 4, !annotation [[AUTO_INIT]]
+// ZERO: store i32 0, ptr %uninit, align 4, !annotation [[AUTO_INIT]]
TEST_BRACES(smallenum, smallenum);
// CHECK-LABEL: @test_smallenum_braces()
// CHECK: %braces = alloca i32, align [[ALIGN:[0-9]*]]
-// CHECK-NEXT: store i32 0, i32* %braces, align [[ALIGN]]
+// CHECK-NEXT: store i32 0, ptr %braces, align [[ALIGN]]
// CHECK-NOT: !annotation
// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)
TEST_CUSTOM(smallenum, smallenum, { (smallenum)42 });
// CHECK-LABEL: @test_smallenum_custom()
// CHECK: %custom = alloca i32, align [[ALIGN:[0-9]*]]
-// CHECK-NEXT: store i32 42, i32* %custom, align [[ALIGN]]
+// CHECK-NEXT: store i32 42, ptr %custom, align [[ALIGN]]
// CHECK-NOT: !annotation
// CHECK-NEXT: call void @{{.*}}used{{.*}}%custom)
@@ -1644,21 +1587,21 @@ TEST_UNINIT(intvec16, int __attribute__((vector_size(16))));
// CHECK: %uninit = alloca <4 x i32>, align
// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)
// PATTERN-LABEL: @test_intvec16_uninit()
-// PATTERN: store <4 x i32> <i32 [[I32]], i32 [[I32]], i32 [[I32]], i32 [[I32]]>, <4 x i32>* %uninit, align 16, !annotation [[AUTO_INIT]]
+// PATTERN: store <4 x i32> <i32 [[I32]], i32 [[I32]], i32 [[I32]], i32 [[I32]]>, ptr %uninit, align 16, !annotation [[AUTO_INIT]]
// ZERO-LABEL: @test_intvec16_uninit()
-// ZERO: store <4 x i32> zeroinitializer, <4 x i32>* %uninit, align 16, !annotation [[AUTO_INIT]]
+// ZERO: store <4 x i32> zeroinitializer, ptr %uninit, align 16, !annotation [[AUTO_INIT]]
TEST_BRACES(intvec16, int __attribute__((vector_size(16))));
// CHECK-LABEL: @test_intvec16_braces()
// CHECK: %braces = alloca <4 x i32>, align [[ALIGN:[0-9]*]]
-// CHECK-NEXT: store <4 x i32> zeroinitializer, <4 x i32>* %braces, align [[ALIGN]]
+// CHECK-NEXT: store <4 x i32> zeroinitializer, ptr %braces, align [[ALIGN]]
// CHECK-NOT: !annotation
// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)
TEST_CUSTOM(intvec16, int __attribute__((vector_size(16))), { 0x44444444, 0x44444444, 0x44444444, 0x44444444 });
// CHECK-LABEL: @test_intvec16_custom()
// CHECK: %custom = alloca <4 x i32>, align [[ALIGN:[0-9]*]]
-// CHECK-NEXT: store <4 x i32> <i32 1145324612, i32 1145324612, i32 1145324612, i32 1145324612>, <4 x i32>* %custom, align [[ALIGN]]
+// CHECK-NEXT: store <4 x i32> <i32 1145324612, i32 1145324612, i32 1145324612, i32 1145324612>, ptr %custom, align [[ALIGN]]
// CHECK-NOT: !annotation
// CHECK-NEXT: call void @{{.*}}used{{.*}}%custom)
@@ -1667,21 +1610,21 @@ TEST_UNINIT(longlongvec32, long long __attribute__((vector_size(32))));
// CHECK: %uninit = alloca <4 x i64>, align
// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)
// PATTERN-LABEL: @test_longlongvec32_uninit()
-// PATTERN: store <4 x i64> <i64 [[I64]], i64 [[I64]], i64 [[I64]], i64 [[I64]]>, <4 x i64>* %uninit, align 32, !annotation [[AUTO_INIT]]
+// PATTERN: store <4 x i64> <i64 [[I64]], i64 [[I64]], i64 [[I64]], i64 [[I64]]>, ptr %uninit, align 32, !annotation [[AUTO_INIT]]
// ZERO-LABEL: @test_longlongvec32_uninit()
-// ZERO: store <4 x i64> zeroinitializer, <4 x i64>* %uninit, align 32, !annotation [[AUTO_INIT]]
+// ZERO: store <4 x i64> zeroinitializer, ptr %uninit, align 32, !annotation [[AUTO_INIT]]
TEST_BRACES(longlongvec32, long long __attribute__((vector_size(32))));
// CHECK-LABEL: @test_longlongvec32_braces()
// CHECK: %braces = alloca <4 x i64>, align [[ALIGN:[0-9]*]]
-// CHECK-NEXT: store <4 x i64> zeroinitializer, <4 x i64>* %braces, align [[ALIGN]]
+// CHECK-NEXT: store <4 x i64> zeroinitializer, ptr %braces, align [[ALIGN]]
// CHECK-NOT: !annotation
// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)
TEST_CUSTOM(longlongvec32, long long __attribute__((vector_size(32))), { 0x3333333333333333, 0x3333333333333333, 0x3333333333333333, 0x3333333333333333 });
// CHECK-LABEL: @test_longlongvec32_custom()
// CHECK: %custom = alloca <4 x i64>, align [[ALIGN:[0-9]*]]
-// CHECK-NEXT: store <4 x i64> <i64 3689348814741910323, i64 3689348814741910323, i64 3689348814741910323, i64 3689348814741910323>, <4 x i64>* %custom, align [[ALIGN]]
+// CHECK-NEXT: store <4 x i64> <i64 3689348814741910323, i64 3689348814741910323, i64 3689348814741910323, i64 3689348814741910323>, ptr %custom, align [[ALIGN]]
// CHECK-NEXT: call void @{{.*}}used{{.*}}%custom)
TEST_UNINIT(floatvec16, float __attribute__((vector_size(16))));
@@ -1689,21 +1632,21 @@ TEST_UNINIT(floatvec16, float __attribute__((vector_size(16))));
// CHECK: %uninit = alloca <4 x float>, align
// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)
// PATTERN-LABEL: @test_floatvec16_uninit()
-// PATTERN: store <4 x float> <float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000>, <4 x float>* %uninit, align 16, !annotation [[AUTO_INIT]]
+// PATTERN: store <4 x float> <float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000>, ptr %uninit, align 16, !annotation [[AUTO_INIT]]
// ZERO-LABEL: @test_floatvec16_uninit()
-// ZERO: store <4 x float> zeroinitializer, <4 x float>* %uninit, align 16, !annotation [[AUTO_INIT]]
+// ZERO: store <4 x float> zeroinitializer, ptr %uninit, align 16, !annotation [[AUTO_INIT]]
TEST_BRACES(floatvec16, float __attribute__((vector_size(16))));
// CHECK-LABEL: @test_floatvec16_braces()
// CHECK: %braces = alloca <4 x float>, align [[ALIGN:[0-9]*]]
-// CHECK-NEXT: store <4 x float> zeroinitializer, <4 x float>* %braces, align [[ALIGN]]
+// CHECK-NEXT: store <4 x float> zeroinitializer, ptr %braces, align [[ALIGN]]
// CHECK-NOT: !annotation
// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)
TEST_CUSTOM(floatvec16, float __attribute__((vector_size(16))), { 3.1415926535897932384626433, 3.1415926535897932384626433, 3.1415926535897932384626433, 3.1415926535897932384626433 });
// CHECK-LABEL: @test_floatvec16_custom()
// CHECK: %custom = alloca <4 x float>, align [[ALIGN:[0-9]*]]
-// CHECK-NEXT: store <4 x float> <float 0x400921FB60000000, float 0x400921FB60000000, float 0x400921FB60000000, float 0x400921FB60000000>, <4 x float>* %custom, align [[ALIGN]]
+// CHECK-NEXT: store <4 x float> <float 0x400921FB60000000, float 0x400921FB60000000, float 0x400921FB60000000, float 0x400921FB60000000>, ptr %custom, align [[ALIGN]]
// CHECK-NOT: !annotation
// CHECK-NEXT: call void @{{.*}}used{{.*}}%custom)
@@ -1712,21 +1655,21 @@ TEST_UNINIT(doublevec32, double __attribute__((vector_size(32))));
// CHECK: %uninit = alloca <4 x double>, align
// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)
// PATTERN-LABEL: @test_doublevec32_uninit()
-// PATTERN: store <4 x double> <double 0xFFFFFFFFFFFFFFFF, double 0xFFFFFFFFFFFFFFFF, double 0xFFFFFFFFFFFFFFFF, double 0xFFFFFFFFFFFFFFFF>, <4 x double>* %uninit, align 32, !annotation [[AUTO_INIT]]
+// PATTERN: store <4 x double> <double 0xFFFFFFFFFFFFFFFF, double 0xFFFFFFFFFFFFFFFF, double 0xFFFFFFFFFFFFFFFF, double 0xFFFFFFFFFFFFFFFF>, ptr %uninit, align 32, !annotation [[AUTO_INIT]]
// ZERO-LABEL: @test_doublevec32_uninit()
-// ZERO: store <4 x double> zeroinitializer, <4 x double>* %uninit, align 32, !annotation [[AUTO_INIT]]
+// ZERO: store <4 x double> zeroinitializer, ptr %uninit, align 32, !annotation [[AUTO_INIT]]
TEST_BRACES(doublevec32, double __attribute__((vector_size(32))));
// CHECK-LABEL: @test_doublevec32_braces()
// CHECK: %braces = alloca <4 x double>, align [[ALIGN:[0-9]*]]
-// CHECK-NEXT: store <4 x double> zeroinitializer, <4 x double>* %braces, align [[ALIGN]]
+// CHECK-NEXT: store <4 x double> zeroinitializer, ptr %braces, align [[ALIGN]]
// CHECK-NOT: !annotation
// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)
TEST_CUSTOM(doublevec32, double __attribute__((vector_size(32))), { 3.1415926535897932384626433, 3.1415926535897932384626433, 3.1415926535897932384626433, 3.1415926535897932384626433 });
// CHECK-LABEL: @test_doublevec32_custom()
// CHECK: %custom = alloca <4 x double>, align [[ALIGN:[0-9]*]]
-// CHECK-NEXT: store <4 x double> <double 0x400921FB54442D18, double 0x400921FB54442D18, double 0x400921FB54442D18, double 0x400921FB54442D18>, <4 x double>* %custom, align [[ALIGN]]
+// CHECK-NEXT: store <4 x double> <double 0x400921FB54442D18, double 0x400921FB54442D18, double 0x400921FB54442D18, double 0x400921FB54442D18>, ptr %custom, align [[ALIGN]]
// CHECK-NOT: !annotation
// CHECK-NEXT: call void @{{.*}}used{{.*}}%custom)
@@ -1736,9 +1679,9 @@ TEST_UNINIT(doublevec24, double __attribute__((vector_size(24))));
// CHECK: %uninit = alloca <3 x double>, align
// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)
// PATTERN-LABEL: @test_doublevec24_uninit()
-// PATTERN: store <3 x double> <double 0xFFFFFFFFFFFFFFFF, double 0xFFFFFFFFFFFFFFFF, double 0xFFFFFFFFFFFFFFFF>, <3 x double>* %uninit, align 32, !annotation [[AUTO_INIT]]
+// PATTERN: store <3 x double> <double 0xFFFFFFFFFFFFFFFF, double 0xFFFFFFFFFFFFFFFF, double 0xFFFFFFFFFFFFFFFF>, ptr %uninit, align 32, !annotation [[AUTO_INIT]]
// ZERO-LABEL: @test_doublevec24_uninit()
-// ZERO: store <3 x double> zeroinitializer, <3 x double>* %uninit, align 32, !annotation [[AUTO_INIT]]
+// ZERO: store <3 x double> zeroinitializer, ptr %uninit, align 32, !annotation [[AUTO_INIT]]
// TODO: This vector has tail padding
TEST_UNINIT(longdoublevec32, long double __attribute__((vector_size(sizeof(long double)*2))));
@@ -1746,9 +1689,9 @@ TEST_UNINIT(longdoublevec32, long double __attribute__((vector_size(sizeof(long
// CHECK: %uninit = alloca <2 x x86_fp80>, align
// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)
// PATTERN-LABEL: @test_longdoublevec32_uninit()
-// PATTERN: store <2 x x86_fp80> <x86_fp80 0xKFFFFFFFFFFFFFFFFFFFF, x86_fp80 0xKFFFFFFFFFFFFFFFFFFFF>, <2 x x86_fp80>* %uninit, align 32, !annotation [[AUTO_INIT]]
+// PATTERN: store <2 x x86_fp80> <x86_fp80 0xKFFFFFFFFFFFFFFFFFFFF, x86_fp80 0xKFFFFFFFFFFFFFFFFFFFF>, ptr %uninit, align 32, !annotation [[AUTO_INIT]]
// ZERO-LABEL: @test_longdoublevec32_uninit()
-// ZERO: store <2 x x86_fp80> zeroinitializer, <2 x x86_fp80>* %uninit, align 32, !annotation [[AUTO_INIT]]
+// ZERO: store <2 x x86_fp80> zeroinitializer, ptr %uninit, align 32, !annotation [[AUTO_INIT]]
} // extern "C"
diff --git a/clang/test/CodeGenCXX/microsoft-abi-dynamic-cast.cpp b/clang/test/CodeGenCXX/microsoft-abi-dynamic-cast.cpp
index 4ade85c9d67de..2ec620eb19d22 100644
--- a/clang/test/CodeGenCXX/microsoft-abi-dynamic-cast.cpp
+++ b/clang/test/CodeGenCXX/microsoft-abi-dynamic-cast.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -no-opaque-pointers -emit-llvm -O1 -o - -fexceptions -triple=i386-pc-win32 %s | FileCheck %s
+// RUN: %clang_cc1 -emit-llvm -O1 -o - -fexceptions -triple=i386-pc-win32 %s | FileCheck %s
struct S { char a; };
struct V { virtual void f(); };
@@ -7,120 +7,99 @@ struct B : S, virtual V {};
struct T {};
T* test0() { return dynamic_cast<T*>((B*)0); }
-// CHECK-LABEL: define dso_local noalias noundef %struct.T* @"?test0@@YAPAUT@@XZ"()
-// CHECK: ret %struct.T* null
+// CHECK-LABEL: define dso_local noalias noundef ptr @"?test0@@YAPAUT@@XZ"()
+// CHECK: ret ptr null
T* test1(V* x) { return &dynamic_cast<T&>(*x); }
-// CHECK-LABEL: define dso_local noundef %struct.T* @"?test1@@YAPAUT@@PAUV@@@Z"(%struct.V* noundef %x)
-// CHECK: [[CAST:%.*]] = bitcast %struct.V* %x to i8*
-// CHECK-NEXT: [[CALL:%.*]] = tail call i8* @__RTDynamicCast(i8* [[CAST]], i32 0, i8* nonnull bitcast (%rtti.TypeDescriptor7* @"??_R0?AUV@@@8" to i8*), i8* nonnull bitcast (%rtti.TypeDescriptor7* @"??_R0?AUT@@@8" to i8*), i32 1)
-// CHECK-NEXT: [[RET:%.*]] = bitcast i8* [[CALL]] to %struct.T*
-// CHECK-NEXT: ret %struct.T* [[RET]]
+// CHECK-LABEL: define dso_local noundef ptr @"?test1@@YAPAUT@@PAUV@@@Z"(ptr noundef %x)
+// CHECK: [[CALL:%.*]] = tail call ptr @__RTDynamicCast(ptr %x, i32 0, ptr nonnull @"??_R0?AUV@@@8", ptr nonnull @"??_R0?AUT@@@8", i32 1)
+// CHECK-NEXT: ret ptr [[CALL]]
T* test2(A* x) { return &dynamic_cast<T&>(*x); }
-// CHECK-LABEL: define dso_local noundef %struct.T* @"?test2@@YAPAUT@@PAUA@@@Z"(%struct.A* noundef %x)
-// CHECK: [[CAST:%.*]] = bitcast %struct.A* %x to i8*
-// CHECK-NEXT: [[VBPTRPTR:%.*]] = getelementptr %struct.A, %struct.A* %x, i32 0, i32 0
-// CHECK-NEXT: [[VBTBL:%.*]] = load i32*, i32** [[VBPTRPTR]], align 4
-// CHECK-NEXT: [[VBOFFP:%.*]] = getelementptr inbounds i32, i32* [[VBTBL]], i32 1
-// CHECK-NEXT: [[VBOFFS:%.*]] = load i32, i32* [[VBOFFP]], align 4
-// CHECK-NEXT: [[ADJ:%.*]] = getelementptr inbounds i8, i8* [[CAST]], i32 [[VBOFFS]]
-// CHECK-NEXT: [[CALL:%.*]] = tail call i8* @__RTDynamicCast(i8* [[ADJ]], i32 [[VBOFFS]], i8* nonnull bitcast (%rtti.TypeDescriptor7* @"??_R0?AUA@@@8" to i8*), i8* nonnull bitcast (%rtti.TypeDescriptor7* @"??_R0?AUT@@@8" to i8*), i32 1)
-// CHECK-NEXT: [[RET:%.*]] = bitcast i8* [[CALL]] to %struct.T*
-// CHECK-NEXT: ret %struct.T* [[RET]]
+// CHECK-LABEL: define dso_local noundef ptr @"?test2@@YAPAUT@@PAUA@@@Z"(ptr noundef %x)
+// CHECK: [[VBTBL:%.*]] = load ptr, ptr %x, align 4
+// CHECK-NEXT: [[VBOFFP:%.*]] = getelementptr inbounds i32, ptr [[VBTBL]], i32 1
+// CHECK-NEXT: [[VBOFFS:%.*]] = load i32, ptr [[VBOFFP]], align 4
+// CHECK-NEXT: [[ADJ:%.*]] = getelementptr inbounds i8, ptr %x, i32 [[VBOFFS]]
+// CHECK-NEXT: [[CALL:%.*]] = tail call ptr @__RTDynamicCast(ptr nonnull [[ADJ]], i32 [[VBOFFS]], ptr nonnull @"??_R0?AUA@@@8", ptr nonnull @"??_R0?AUT@@@8", i32 1)
+// CHECK-NEXT: ret ptr [[CALL]]
T* test3(B* x) { return &dynamic_cast<T&>(*x); }
-// CHECK-LABEL: define dso_local noundef %struct.T* @"?test3@@YAPAUT@@PAUB@@@Z"(%struct.B* noundef %x)
-// CHECK: [[VOIDP:%.*]] = getelementptr %struct.B, %struct.B* %x, i32 0, i32 0, i32 0
-// CHECK-NEXT: [[VBPTR:%.*]] = getelementptr inbounds i8, i8* [[VOIDP]], i32 4
-// CHECK-NEXT: [[VBPTRPTR:%.*]] = bitcast i8* [[VBPTR:%.*]] to i32**
-// CHECK-NEXT: [[VBTBL:%.*]] = load i32*, i32** [[VBPTRPTR]], align 4
-// CHECK-NEXT: [[VBOFFP:%.*]] = getelementptr inbounds i32, i32* [[VBTBL]], i32 1
-// CHECK-NEXT: [[VBOFFS:%.*]] = load i32, i32* [[VBOFFP]], align 4
+// CHECK-LABEL: define dso_local noundef ptr @"?test3@@YAPAUT@@PAUB@@@Z"(ptr noundef %x)
+// CHECK: [[VBPTR:%.*]] = getelementptr inbounds i8, ptr %x, i32 4
+// CHECK-NEXT: [[VBTBL:%.*]] = load ptr, ptr [[VBPTR:%.*]], align 4
+// CHECK-NEXT: [[VBOFFP:%.*]] = getelementptr inbounds i32, ptr [[VBTBL]], i32 1
+// CHECK-NEXT: [[VBOFFS:%.*]] = load i32, ptr [[VBOFFP]], align 4
// CHECK-NEXT: [[DELTA:%.*]] = add nsw i32 [[VBOFFS]], 4
-// CHECK-NEXT: [[ADJ:%.*]] = getelementptr inbounds i8, i8* [[VOIDP]], i32 [[DELTA]]
-// CHECK-NEXT: [[CALL:%.*]] = tail call i8* @__RTDynamicCast(i8* [[ADJ]], i32 [[DELTA]], i8* nonnull bitcast (%rtti.TypeDescriptor7* @"??_R0?AUB@@@8" to i8*), i8* nonnull bitcast (%rtti.TypeDescriptor7* @"??_R0?AUT@@@8" to i8*), i32 1)
-// CHECK-NEXT: [[RET:%.*]] = bitcast i8* [[CALL]] to %struct.T*
-// CHECK-NEXT: ret %struct.T* [[RET]]
+// CHECK-NEXT: [[ADJ:%.*]] = getelementptr inbounds i8, ptr %x, i32 [[DELTA]]
+// CHECK-NEXT: [[CALL:%.*]] = tail call ptr @__RTDynamicCast(ptr [[ADJ]], i32 [[DELTA]], ptr nonnull @"??_R0?AUB@@@8", ptr nonnull @"??_R0?AUT@@@8", i32 1)
+// CHECK-NEXT: ret ptr [[CALL]]
T* test4(V* x) { return dynamic_cast<T*>(x); }
-// CHECK-LABEL: define dso_local noundef %struct.T* @"?test4@@YAPAUT@@PAUV@@@Z"(%struct.V* noundef %x)
-// CHECK: [[CAST:%.*]] = bitcast %struct.V* %x to i8*
-// CHECK-NEXT: [[CALL:%.*]] = tail call i8* @__RTDynamicCast(i8* [[CAST]], i32 0, i8* nonnull bitcast (%rtti.TypeDescriptor7* @"??_R0?AUV@@@8" to i8*), i8* nonnull bitcast (%rtti.TypeDescriptor7* @"??_R0?AUT@@@8" to i8*), i32 0)
-// CHECK-NEXT: [[RET:%.*]] = bitcast i8* [[CALL]] to %struct.T*
-// CHECK-NEXT: ret %struct.T* [[RET]]
+// CHECK-LABEL: define dso_local noundef ptr @"?test4@@YAPAUT@@PAUV@@@Z"(ptr noundef %x)
+// CHECK: [[CALL:%.*]] = tail call ptr @__RTDynamicCast(ptr %x, i32 0, ptr nonnull @"??_R0?AUV@@@8", ptr nonnull @"??_R0?AUT@@@8", i32 0)
+// CHECK-NEXT: ret ptr [[CALL]]
T* test5(A* x) { return dynamic_cast<T*>(x); }
-// CHECK-LABEL: define dso_local noundef %struct.T* @"?test5@@YAPAUT@@PAUA@@@Z"(%struct.A* noundef %x)
-// CHECK: [[CHECK:%.*]] = icmp eq %struct.A* %x, null
+// CHECK-LABEL: define dso_local noundef ptr @"?test5@@YAPAUT@@PAUA@@@Z"(ptr noundef %x)
+// CHECK: [[CHECK:%.*]] = icmp eq ptr %x, null
// CHECK-NEXT: br i1 [[CHECK]]
-// CHECK: [[VOIDP:%.*]] = bitcast %struct.A* %x to i8*
-// CHECK-NEXT: [[VBPTRPTR:%.*]] = getelementptr %struct.A, %struct.A* %x, i32 0, i32 0
-// CHECK-NEXT: [[VBTBL:%.*]] = load i32*, i32** [[VBPTRPTR]], align 4
-// CHECK-NEXT: [[VBOFFP:%.*]] = getelementptr inbounds i32, i32* [[VBTBL]], i32 1
-// CHECK-NEXT: [[VBOFFS:%.*]] = load i32, i32* [[VBOFFP]], align 4
-// CHECK-NEXT: [[ADJ:%.*]] = getelementptr inbounds i8, i8* [[VOIDP]], i32 [[VBOFFS]]
-// CHECK-NEXT: [[CALL:%.*]] = tail call i8* @__RTDynamicCast(i8* nonnull [[ADJ]], i32 [[VBOFFS]], i8* {{.*}}bitcast (%rtti.TypeDescriptor7* @"??_R0?AUA@@@8" to i8*), i8* {{.*}}bitcast (%rtti.TypeDescriptor7* @"??_R0?AUT@@@8" to i8*), i32 0)
-// CHECK-NEXT: [[RES:%.*]] = bitcast i8* [[CALL]] to %struct.T*
+// CHECK: [[VBTBL:%.*]] = load ptr, ptr %x, align 4
+// CHECK-NEXT: [[VBOFFP:%.*]] = getelementptr inbounds i32, ptr [[VBTBL]], i32 1
+// CHECK-NEXT: [[VBOFFS:%.*]] = load i32, ptr [[VBOFFP]], align 4
+// CHECK-NEXT: [[ADJ:%.*]] = getelementptr inbounds i8, ptr %x, i32 [[VBOFFS]]
+// CHECK-NEXT: [[CALL:%.*]] = tail call ptr @__RTDynamicCast(ptr nonnull [[ADJ]], i32 [[VBOFFS]], ptr {{.*}}@"??_R0?AUA@@@8", ptr {{.*}}@"??_R0?AUT@@@8", i32 0)
// CHECK-NEXT: br label
-// CHECK: [[RET:%.*]] = phi %struct.T*
-// CHECK-NEXT: ret %struct.T* [[RET]]
+// CHECK: [[RET:%.*]] = phi ptr
+// CHECK-NEXT: ret ptr [[RET]]
T* test6(B* x) { return dynamic_cast<T*>(x); }
-// CHECK-LABEL: define dso_local noundef %struct.T* @"?test6@@YAPAUT@@PAUB@@@Z"(%struct.B* noundef %x)
-// CHECK: [[CHECK:%.*]] = icmp eq %struct.B* %x, null
+// CHECK-LABEL: define dso_local noundef ptr @"?test6@@YAPAUT@@PAUB@@@Z"(ptr noundef %x)
+// CHECK: [[CHECK:%.*]] = icmp eq ptr %x, null
// CHECK-NEXT: br i1 [[CHECK]]
-// CHECK: [[CAST:%.*]] = getelementptr %struct.B, %struct.B* %x, i32 0, i32 0, i32 0
-// CHECK-NEXT: [[VBPTR:%.*]] = getelementptr inbounds i8, i8* [[CAST]], i32 4
-// CHECK-NEXT: [[VBPTRPTR:%.*]] = bitcast i8* [[VBPTR]] to i32**
-// CHECK-NEXT: [[VBTBL:%.*]] = load i32*, i32** [[VBPTRPTR]], align 4
-// CHECK-NEXT: [[VBOFFP:%.*]] = getelementptr inbounds i32, i32* [[VBTBL]], i32 1
-// CHECK-NEXT: [[VBOFFS:%.*]] = load i32, i32* [[VBOFFP]], align 4
+// CHECK: [[VBPTR:%.*]] = getelementptr inbounds i8, ptr %x, i32 4
+// CHECK-NEXT: [[VBTBL:%.*]] = load ptr, ptr [[VBPTR]], align 4
+// CHECK-NEXT: [[VBOFFP:%.*]] = getelementptr inbounds i32, ptr [[VBTBL]], i32 1
+// CHECK-NEXT: [[VBOFFS:%.*]] = load i32, ptr [[VBOFFP]], align 4
// CHECK-NEXT: [[DELTA:%.*]] = add nsw i32 [[VBOFFS]], 4
-// CHECK-NEXT: [[ADJ:%.*]] = getelementptr inbounds i8, i8* [[CAST]], i32 [[DELTA]]
-// CHECK-NEXT: [[CALL:%.*]] = tail call i8* @__RTDynamicCast(i8* [[ADJ]], i32 [[DELTA]], i8* {{.*}}bitcast (%rtti.TypeDescriptor7* @"??_R0?AUB@@@8" to i8*), i8* {{.*}}bitcast (%rtti.TypeDescriptor7* @"??_R0?AUT@@@8" to i8*), i32 0)
-// CHECK-NEXT: [[RES:%.*]] = bitcast i8* [[CALL]] to %struct.T*
+// CHECK-NEXT: [[ADJ:%.*]] = getelementptr inbounds i8, ptr %x, i32 [[DELTA]]
+// CHECK-NEXT: [[CALL:%.*]] = tail call ptr @__RTDynamicCast(ptr nonnull [[ADJ]], i32 [[DELTA]], ptr {{.*}}@"??_R0?AUB@@@8", ptr {{.*}}@"??_R0?AUT@@@8", i32 0)
// CHECK-NEXT: br label
-// CHECK: [[RET:%.*]] = phi %struct.T*
-// CHECK-NEXT: ret %struct.T* [[RET]]
+// CHECK: [[RET:%.*]] = phi ptr
+// CHECK-NEXT: ret ptr [[RET]]
void* test7(V* x) { return dynamic_cast<void*>(x); }
-// CHECK-LABEL: define dso_local noundef i8* @"?test7@@YAPAXPAUV@@@Z"(%struct.V* noundef %x)
-// CHECK: [[CAST:%.*]] = bitcast %struct.V* %x to i8*
-// CHECK-NEXT: [[RET:%.*]] = tail call i8* @__RTCastToVoid(i8* [[CAST]])
-// CHECK-NEXT: ret i8* [[RET]]
+// CHECK-LABEL: define dso_local noundef ptr @"?test7@@YAPAXPAUV@@@Z"(ptr noundef %x)
+// CHECK: [[RET:%.*]] = tail call ptr @__RTCastToVoid(ptr %x)
+// CHECK-NEXT: ret ptr [[RET]]
void* test8(A* x) { return dynamic_cast<void*>(x); }
-// CHECK-LABEL: define dso_local noundef i8* @"?test8@@YAPAXPAUA@@@Z"(%struct.A* noundef %x)
-// CHECK: [[CHECK:%.*]] = icmp eq %struct.A* %x, null
+// CHECK-LABEL: define dso_local noundef ptr @"?test8@@YAPAXPAUA@@@Z"(ptr noundef %x)
+// CHECK: [[CHECK:%.*]] = icmp eq ptr %x, null
// CHECK-NEXT: br i1 [[CHECK]]
-// CHECK: [[VOIDP:%.*]] = bitcast %struct.A* %x to i8*
-// CHECK-NEXT: [[VBPTRPTR:%.*]] = getelementptr %struct.A, %struct.A* %x, i32 0, i32 0
-// CHECK-NEXT: [[VBTBL:%.*]] = load i32*, i32** [[VBPTRPTR]], align 4
-// CHECK-NEXT: [[VBOFFP:%.*]] = getelementptr inbounds i32, i32* [[VBTBL]], i32 1
-// CHECK-NEXT: [[VBOFFS:%.*]] = load i32, i32* [[VBOFFP]], align 4
-// CHECK-NEXT: [[ADJ:%.*]] = getelementptr inbounds i8, i8* [[VOIDP]], i32 [[VBOFFS]]
-// CHECK-NEXT: [[RES:%.*]] = tail call i8* @__RTCastToVoid(i8* nonnull [[ADJ]])
+// CHECK: [[VBTBL:%.*]] = load ptr, ptr %x, align 4
+// CHECK-NEXT: [[VBOFFP:%.*]] = getelementptr inbounds i32, ptr [[VBTBL]], i32 1
+// CHECK-NEXT: [[VBOFFS:%.*]] = load i32, ptr [[VBOFFP]], align 4
+// CHECK-NEXT: [[ADJ:%.*]] = getelementptr inbounds i8, ptr %x, i32 [[VBOFFS]]
+// CHECK-NEXT: [[RES:%.*]] = tail call ptr @__RTCastToVoid(ptr nonnull [[ADJ]])
// CHECK-NEXT: br label
-// CHECK: [[RET:%.*]] = phi i8*
-// CHECK-NEXT: ret i8* [[RET]]
+// CHECK: [[RET:%.*]] = phi ptr
+// CHECK-NEXT: ret ptr [[RET]]
void* test9(B* x) { return dynamic_cast<void*>(x); }
-// CHECK-LABEL: define dso_local noundef i8* @"?test9@@YAPAXPAUB@@@Z"(%struct.B* noundef %x)
-// CHECK: [[CHECK:%.*]] = icmp eq %struct.B* %x, null
+// CHECK-LABEL: define dso_local noundef ptr @"?test9@@YAPAXPAUB@@@Z"(ptr noundef %x)
+// CHECK: [[CHECK:%.*]] = icmp eq ptr %x, null
// CHECK-NEXT: br i1 [[CHECK]]
-// CHECK: [[CAST:%.*]] = getelementptr %struct.B, %struct.B* %x, i32 0, i32 0, i32 0
-// CHECK-NEXT: [[VBPTR:%.*]] = getelementptr inbounds i8, i8* [[CAST]], i32 4
-// CHECK-NEXT: [[VBPTRPTR:%.*]] = bitcast i8* [[VBPTR]] to i32**
-// CHECK-NEXT: [[VBTBL:%.*]] = load i32*, i32** [[VBPTRPTR]], align 4
-// CHECK-NEXT: [[VBOFFP:%.*]] = getelementptr inbounds i32, i32* [[VBTBL]], i32 1
-// CHECK-NEXT: [[VBOFFS:%.*]] = load i32, i32* [[VBOFFP]], align 4
+// CHECK: [[VBPTR:%.*]] = getelementptr inbounds i8, ptr %x, i32 4
+// CHECK-NEXT: [[VBTBL:%.*]] = load ptr, ptr [[VBPTR]], align 4
+// CHECK-NEXT: [[VBOFFP:%.*]] = getelementptr inbounds i32, ptr [[VBTBL]], i32 1
+// CHECK-NEXT: [[VBOFFS:%.*]] = load i32, ptr [[VBOFFP]], align 4
// CHECK-NEXT: [[DELTA:%.*]] = add nsw i32 [[VBOFFS]], 4
-// CHECK-NEXT: [[ADJ:%.*]] = getelementptr inbounds i8, i8* [[CAST]], i32 [[DELTA]]
-// CHECK-NEXT: [[CALL:%.*]] = tail call i8* @__RTCastToVoid(i8* [[ADJ]])
+// CHECK-NEXT: [[ADJ:%.*]] = getelementptr inbounds i8, ptr %x, i32 [[DELTA]]
+// CHECK-NEXT: [[CALL:%.*]] = tail call ptr @__RTCastToVoid(ptr nonnull [[ADJ]])
// CHECK-NEXT: br label
-// CHECK: [[RET:%.*]] = phi i8*
-// CHECK-NEXT: ret i8* [[RET]]
+// CHECK: [[RET:%.*]] = phi ptr
+// CHECK-NEXT: ret ptr [[RET]]
namespace PR25606 {
struct Cleanup {
@@ -134,10 +113,9 @@ S3 *f(S2 &s) {
Cleanup c;
return dynamic_cast<S3 *>(&s);
}
-// CHECK-LABEL: define dso_local noundef %"struct.PR25606::S3"* @"?f at PR25606@@YAPAUS3 at 1@AAUS2 at 1@@Z"(
-// CHECK: [[CALL:%.*]] = invoke i8* @__RTDynamicCast
+// CHECK-LABEL: define dso_local noundef ptr @"?f at PR25606@@YAPAUS3 at 1@AAUS2 at 1@@Z"(
+// CHECK: [[CALL:%.*]] = invoke ptr @__RTDynamicCast
-// CHECK: [[BC:%.*]] = bitcast i8* [[CALL]] to %"struct.PR25606::S3"*
// CHECK: call x86_thiscallcc void @"??1Cleanup at PR25606@@QAE at XZ"(
-// CHECK: ret %"struct.PR25606::S3"* [[BC]]
+// CHECK: ret ptr [[CALL]]
}
diff --git a/clang/test/CodeGenCXX/microsoft-abi-typeid.cpp b/clang/test/CodeGenCXX/microsoft-abi-typeid.cpp
index 8b41c5a4a6c58..5b3c812c07846 100644
--- a/clang/test/CodeGenCXX/microsoft-abi-typeid.cpp
+++ b/clang/test/CodeGenCXX/microsoft-abi-typeid.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -no-opaque-pointers -emit-llvm -O1 -o - -triple=i386-pc-win32 %s -fexceptions -fcxx-exceptions | FileCheck %s
+// RUN: %clang_cc1 -emit-llvm -O1 -o - -triple=i386-pc-win32 %s -fexceptions -fcxx-exceptions | FileCheck %s
struct type_info;
namespace std { using ::type_info; }
@@ -12,45 +12,42 @@ extern int b;
A* fn();
const std::type_info* test0_typeid() { return &typeid(int); }
-// CHECK-LABEL: define dso_local noundef nonnull %struct.type_info* @"?test0_typeid@@YAPBUtype_info@@XZ"()
-// CHECK: ret %struct.type_info* bitcast (%rtti.TypeDescriptor2* @"??_R0H at 8" to %struct.type_info*)
+// CHECK-LABEL: define dso_local noundef nonnull ptr @"?test0_typeid@@YAPBUtype_info@@XZ"()
+// CHECK: ret ptr @"??_R0H at 8"
const std::type_info* test1_typeid() { return &typeid(A); }
-// CHECK-LABEL: define dso_local noundef nonnull %struct.type_info* @"?test1_typeid@@YAPBUtype_info@@XZ"()
-// CHECK: ret %struct.type_info* bitcast (%rtti.TypeDescriptor7* @"??_R0?AUA@@@8" to %struct.type_info*)
+// CHECK-LABEL: define dso_local noundef nonnull ptr @"?test1_typeid@@YAPBUtype_info@@XZ"()
+// CHECK: ret ptr @"??_R0?AUA@@@8"
const std::type_info* test2_typeid() { return &typeid(&a); }
-// CHECK-LABEL: define dso_local noundef nonnull %struct.type_info* @"?test2_typeid@@YAPBUtype_info@@XZ"()
-// CHECK: ret %struct.type_info* bitcast (%rtti.TypeDescriptor7* @"??_R0PAUA@@@8" to %struct.type_info*)
+// CHECK-LABEL: define dso_local noundef nonnull ptr @"?test2_typeid@@YAPBUtype_info@@XZ"()
+// CHECK: ret ptr @"??_R0PAUA@@@8"
const std::type_info* test3_typeid() { return &typeid(*fn()); }
-// CHECK-LABEL: define dso_local noundef %struct.type_info* @"?test3_typeid@@YAPBUtype_info@@XZ"()
-// CHECK: [[CALL:%.*]] = tail call noundef %struct.A* @"?fn@@YAPAUA@@XZ"()
-// CHECK-NEXT: [[CMP:%.*]] = icmp eq %struct.A* [[CALL]], null
+// CHECK-LABEL: define dso_local noundef ptr @"?test3_typeid@@YAPBUtype_info@@XZ"()
+// CHECK: [[CALL:%.*]] = tail call noundef ptr @"?fn@@YAPAUA@@XZ"()
+// CHECK-NEXT: [[CMP:%.*]] = icmp eq ptr [[CALL]], null
// CHECK-NEXT: br i1 [[CMP]]
-// CHECK: call i8* @__RTtypeid(i8* null)
+// CHECK: call ptr @__RTtypeid(ptr null)
// CHECK-NEXT: unreachable
-// CHECK: [[THIS:%.*]] = bitcast %struct.A* [[CALL]] to i8*
-// CHECK-NEXT: [[VBTBLP:%.*]] = getelementptr %struct.A, %struct.A* [[CALL]], i32 0, i32 0
-// CHECK-NEXT: [[VBTBL:%.*]] = load i32*, i32** [[VBTBLP]], align 4
-// CHECK-NEXT: [[VBSLOT:%.*]] = getelementptr inbounds i32, i32* [[VBTBL]], i32 1
-// CHECK-NEXT: [[VBASE_OFFS:%.*]] = load i32, i32* [[VBSLOT]], align 4
-// CHECK-NEXT: [[ADJ:%.*]] = getelementptr inbounds i8, i8* [[THIS]], i32 [[VBASE_OFFS]]
-// CHECK-NEXT: [[RT:%.*]] = tail call i8* @__RTtypeid(i8* nonnull [[ADJ]])
-// CHECK-NEXT: [[RET:%.*]] = bitcast i8* [[RT]] to %struct.type_info*
-// CHECK-NEXT: ret %struct.type_info* [[RET]]
+// CHECK: [[VBTBL:%.*]] = load ptr, ptr [[CALL]], align 4
+// CHECK-NEXT: [[VBSLOT:%.*]] = getelementptr inbounds i32, ptr [[VBTBL]], i32 1
+// CHECK-NEXT: [[VBASE_OFFS:%.*]] = load i32, ptr [[VBSLOT]], align 4
+// CHECK-NEXT: [[ADJ:%.*]] = getelementptr inbounds i8, ptr [[CALL]], i32 [[VBASE_OFFS]]
+// CHECK-NEXT: [[RT:%.*]] = tail call ptr @__RTtypeid(ptr nonnull [[ADJ]])
+// CHECK-NEXT: ret ptr [[RT]]
const std::type_info* test4_typeid() { return &typeid(b); }
-// CHECK: define dso_local noundef nonnull %struct.type_info* @"?test4_typeid@@YAPBUtype_info@@XZ"()
-// CHECK: ret %struct.type_info* bitcast (%rtti.TypeDescriptor2* @"??_R0H at 8" to %struct.type_info*)
+// CHECK: define dso_local noundef nonnull ptr @"?test4_typeid@@YAPBUtype_info@@XZ"()
+// CHECK: ret ptr @"??_R0H at 8"
const std::type_info* test5_typeid() { return &typeid(v); }
-// CHECK: define dso_local noundef nonnull %struct.type_info* @"?test5_typeid@@YAPBUtype_info@@XZ"()
-// CHECK: ret %struct.type_info* bitcast (%rtti.TypeDescriptor7* @"??_R0?AUV@@@8" to %struct.type_info*)
+// CHECK: define dso_local noundef nonnull ptr @"?test5_typeid@@YAPBUtype_info@@XZ"()
+// CHECK: ret ptr @"??_R0?AUV@@@8"
const std::type_info *test6_typeid() { return &typeid((V &)v); }
-// CHECK: define dso_local noundef nonnull %struct.type_info* @"?test6_typeid@@YAPBUtype_info@@XZ"()
-// CHECK: ret %struct.type_info* bitcast (%rtti.TypeDescriptor7* @"??_R0?AUV@@@8" to %struct.type_info*)
+// CHECK: define dso_local noundef nonnull ptr @"?test6_typeid@@YAPBUtype_info@@XZ"()
+// CHECK: ret ptr @"??_R0?AUV@@@8"
namespace PR26329 {
struct Polymorphic {
@@ -67,6 +64,6 @@ void f(const Polymorphic &poly) {
}
// CHECK-LABEL: define dso_local void @"?f at PR26329@@YAXABUPolymorphic at 1@@Z"(
// CHECK: %[[cs:.*]] = catchswitch within none [label %{{.*}}] unwind to caller
-// CHECK: %[[cp:.*]] = catchpad within %[[cs]] [i8* null, i32 64, i8* null]
-// CHECK: invoke i8* @__RTtypeid(i8* {{.*}}) [ "funclet"(token %[[cp]]) ]
+// CHECK: %[[cp:.*]] = catchpad within %[[cs]] [ptr null, i32 64, ptr null]
+// CHECK: invoke ptr @__RTtypeid(ptr {{.*}}) [ "funclet"(token %[[cp]]) ]
}
More information about the cfe-commits
mailing list