Author: Erich Keane Date: 2021-10-20T12:27:22-07:00 New Revision: 4e21caece0dd72450b6ac72d1bcedd697c666efc
URL: https://github.com/llvm/llvm-project/commit/4e21caece0dd72450b6ac72d1bcedd697c666efc DIFF: https://github.com/llvm/llvm-project/commit/4e21caece0dd72450b6ac72d1bcedd697c666efc.diff LOG: Update ext-int test to have x86 linux/windows before ABI Impl Writing a quick test to make sure we are aware of the change to the _ExtInt/_BitInt ABI on x86 (32bit) OSes. Added: Modified: clang/test/CodeGenCXX/ext-int.cpp Removed: ################################################################################ diff --git a/clang/test/CodeGenCXX/ext-int.cpp b/clang/test/CodeGenCXX/ext-int.cpp index 3cbcf1331eaff..88b5ff91d470e 100644 --- a/clang/test/CodeGenCXX/ext-int.cpp +++ b/clang/test/CodeGenCXX/ext-int.cpp @@ -1,8 +1,14 @@ -// RUN: %clang_cc1 -triple x86_64-gnu-linux -O3 -disable-llvm-passes -I%S -emit-llvm -o - %s | FileCheck %s --check-prefixes=CHECK,LIN,NoNewStructPathTBAA -// RUN: %clang_cc1 -triple x86_64-gnu-linux -O3 -disable-llvm-passes -I%S -new-struct-path-tbaa -emit-llvm -o - %s | FileCheck %s --check-prefixes=CHECK,LIN,NewStructPathTBAA +// RUN: %clang_cc1 -triple x86_64-gnu-linux -O3 -disable-llvm-passes -I%S -emit-llvm -o - %s | FileCheck %s --check-prefixes=CHECK,LIN,LIN64,NoNewStructPathTBAA +// RUN: %clang_cc1 -triple x86_64-gnu-linux -O3 -disable-llvm-passes -I%S -new-struct-path-tbaa -emit-llvm -o - %s | FileCheck %s --check-prefixes=CHECK,LIN,LIN64,NewStructPathTBAA -// RUN: %clang_cc1 -triple x86_64-windows-pc -O3 -disable-llvm-passes -I%S -emit-llvm -o - %s | FileCheck %s --check-prefixes=CHECK,WIN,NoNewStructPathTBAA -// RUN: %clang_cc1 -triple x86_64-windows-pc -O3 -disable-llvm-passes -I%S -new-struct-path-tbaa -emit-llvm -o - %s | FileCheck %s --check-prefixes=CHECK,WIN,NewStructPathTBAA +// RUN: %clang_cc1 -triple x86_64-windows-pc -O3 -disable-llvm-passes -I%S -emit-llvm -o - %s | FileCheck %s --check-prefixes=CHECK,WIN,WIN64,NoNewStructPathTBAA +// RUN: %clang_cc1 -triple x86_64-windows-pc -O3 -disable-llvm-passes -I%S -new-struct-path-tbaa -emit-llvm -o - %s | FileCheck %s --check-prefixes=CHECK,WIN,WIN64,NewStructPathTBAA + +// RUN: %clang_cc1 -triple i386-gnu-linux -O3 -disable-llvm-passes -I%S -emit-llvm -o - %s | FileCheck %s --check-prefixes=CHECK,LIN,LIN32,NoNewStructPathTBAA +// RUN: %clang_cc1 -triple i386-gnu-linux -O3 -disable-llvm-passes -I%S -new-struct-path-tbaa -emit-llvm -o - %s | FileCheck %s --check-prefixes=CHECK,LIN,LIN32,NewStructPathTBAA + +// RUN: %clang_cc1 -triple i386-windows-pc -O3 -disable-llvm-passes -I%S -emit-llvm -o - %s | FileCheck %s --check-prefixes=CHECK,WIN,WIN32,NoNewStructPathTBAA +// RUN: %clang_cc1 -triple i386-windows-pc -O3 -disable-llvm-passes -I%S -new-struct-path-tbaa -emit-llvm -o - %s | FileCheck %s --check-prefixes=CHECK,WIN,WIN32,NewStructPathTBAA #include <typeinfo> @@ -36,7 +42,8 @@ struct BitFieldsLong { _ExtInt(63) B : 3; _ExtInt(63) C : 2; }; -// LIN: %struct.BitFieldsLong = type { i8, [7 x i8] } +// LIN64: %struct.BitFieldsLong = type { i8, [7 x i8] } +// LIN32: %struct.BitFieldsLong = type { i8, [3 x i8] } // WIN: %struct.BitFieldsLong = type { i64 } struct HasExtIntFirst { @@ -99,20 +106,23 @@ enum AsEnumUnderlyingType : _ExtInt(9) { void UnderlyingTypeUsage(AsEnumUnderlyingType Param) { // LIN: define{{.*}} void @_Z19UnderlyingTypeUsage20AsEnumUnderlyingType(i9 signext % - // WIN: define dso_local void @"?UnderlyingTypeUsage@@YAXW4AsEnumUnderlyingType@@@Z"(i9 % + // WIN64: define dso_local void @"?UnderlyingTypeUsage@@YAXW4AsEnumUnderlyingType@@@Z"(i9 % + // WIN32: define dso_local void @"?UnderlyingTypeUsage@@YAXW4AsEnumUnderlyingType@@@Z"(i9 signext % AsEnumUnderlyingType Var; // CHECK: alloca i9, align 2 // CHECK: store i9 %{{.*}}, align 2 } unsigned _ExtInt(33) ManglingTestRetParam(unsigned _ExtInt(33) Param) { -// LIN: define{{.*}} i64 @_Z20ManglingTestRetParamU7_ExtIntILi33EEj(i64 % +// LIN64: define{{.*}} i64 @_Z20ManglingTestRetParamU7_ExtIntILi33EEj(i64 % +// LIN32: define{{.*}} i33 @_Z20ManglingTestRetParamU7_ExtIntILi33EEj(i33 % // WIN: define dso_local i33 @"?ManglingTestRetParam@@YAU?$_UExtInt@$0CB@@__clang@@U12@@Z"(i33 return 0; } _ExtInt(33) ManglingTestRetParam(_ExtInt(33) Param) { -// LIN: define{{.*}} i64 @_Z20ManglingTestRetParamU7_ExtIntILi33EEi(i64 % +// LIN64: define{{.*}} i64 @_Z20ManglingTestRetParamU7_ExtIntILi33EEi(i64 % +// LIN32: define{{.*}} i33 @_Z20ManglingTestRetParamU7_ExtIntILi33EEi(i33 % // WIN: define dso_local i33 @"?ManglingTestRetParam@@YAU?$_ExtInt@$0CB@@__clang@@U12@@Z"(i33 return 0; } @@ -128,7 +138,8 @@ void ManglingInstantiator() { _ExtInt(93) A; ManglingTestTemplateParam(A); // LIN: call void @_Z25ManglingTestTemplateParamIU7_ExtIntILi93EEiEvRT_(i93* -// WIN: call void @"??$ManglingTestTemplateParam@U?$_ExtInt@$0FN@@__clang@@@@YAXAEAU?$_ExtInt@$0FN@@__clang@@@Z"(i93* +// WIN64: call void @"??$ManglingTestTemplateParam@U?$_ExtInt@$0FN@@__clang@@@@YAXAEAU?$_ExtInt@$0FN@@__clang@@@Z"(i93* +// WIN32: call void @"??$ManglingTestTemplateParam@U?$_ExtInt@$0FN@@__clang@@@@YAXAAU?$_ExtInt@$0FN@@__clang@@@Z"(i93* constexpr _ExtInt(93) B = 993; ManglingTestNTTP<38>(); // LIN: call void @_Z16ManglingTestNTTPILU7_ExtIntILi99EEi38EEvv() @@ -143,108 +154,186 @@ void TakesVarargs(int i, ...) { // WIN: define dso_local void @"?TakesVarargs@@YAXHZZ"(i32 %i, ...) __builtin_va_list args; - // LIN: %[[ARGS:.+]] = alloca [1 x %struct.__va_list_tag] + // LIN64: %[[ARGS:.+]] = alloca [1 x %struct.__va_list_tag] + // LIN32: %[[ARGS:.+]] = alloca i8* // WIN: %[[ARGS:.+]] = alloca i8* __builtin_va_start(args, i); - // LIN: %[[STARTAD:.+]] = getelementptr inbounds [1 x %struct.__va_list_tag], [1 x %struct.__va_list_tag]* %[[ARGS]] - // LIN: %[[STARTAD1:.+]] = bitcast %struct.__va_list_tag* %[[STARTAD]] to i8* - // LIN: call void @llvm.va_start(i8* %[[STARTAD1]]) + // LIN64: %[[STARTAD:.+]] = getelementptr inbounds [1 x %struct.__va_list_tag], [1 x %struct.__va_list_tag]* %[[ARGS]] + // LIN64: %[[STARTAD1:.+]] = bitcast %struct.__va_list_tag* %[[STARTAD]] to i8* + // LIN64: call void @llvm.va_start(i8* %[[STARTAD1]]) + // LIN32: %[[ARGSLLIFETIMESTART:.+]] = bitcast i8** %[[ARGS]] to i8* + // LIN32: %[[ARGSSTART:.+]] = bitcast i8** %[[ARGS]] to i8* + // LIN32: call void @llvm.va_start(i8* %[[ARGSSTART]]) // WIN: %[[ARGSLLIFETIMESTART:.+]] = bitcast i8** %[[ARGS]] to i8* // WIN: %[[ARGSSTART:.+]] = bitcast i8** %[[ARGS]] to i8* // WIN: call void @llvm.va_start(i8* %[[ARGSSTART]]) _ExtInt(92) A = __builtin_va_arg(args, _ExtInt(92)); - // LIN: %[[AD1:.+]] = getelementptr inbounds [1 x %struct.__va_list_tag], [1 x %struct.__va_list_tag]* %[[ARGS]] - // LIN: %[[OFA_P1:.+]] = getelementptr inbounds %struct.__va_list_tag, %struct.__va_list_tag* %[[AD1]], i32 0, i32 0 - // LIN: %[[GPOFFSET:.+]] = load i32, i32* %[[OFA_P1]] - // LIN: %[[FITSINGP:.+]] = icmp ule i32 %[[GPOFFSET]], 32 - // LIN: br i1 %[[FITSINGP]] - // LIN: %[[BC1:.+]] = phi i92* - // LIN: %[[LOAD1:.+]] = load i92, i92* %[[BC1]] - // LIN: store i92 %[[LOAD1]], i92* - - // WIN: %[[CUR1:.+]] = load i8*, i8** %[[ARGS]] - // WIN: %[[NEXT1:.+]] = getelementptr inbounds i8, i8* %[[CUR1]], i64 8 - // WIN: store i8* %[[NEXT1]], i8** %[[ARGS]] - // WIN: %[[BC1:.+]] = bitcast i8* %[[CUR1]] to i92** - // WIN: %[[LOADP1:.+]] = load i92*, i92** %[[BC1]] - // WIN: %[[LOADV1:.+]] = load i92, i92* %[[LOADP1]] - // WIN: store i92 %[[LOADV1]], i92* + // LIN64: %[[AD1:.+]] = getelementptr inbounds [1 x %struct.__va_list_tag], [1 x %struct.__va_list_tag]* %[[ARGS]] + // LIN64: %[[OFA_P1:.+]] = getelementptr inbounds %struct.__va_list_tag, %struct.__va_list_tag* %[[AD1]], i32 0, i32 0 + // LIN64: %[[GPOFFSET:.+]] = load i32, i32* %[[OFA_P1]] + // LIN64: %[[FITSINGP:.+]] = icmp ule i32 %[[GPOFFSET]], 32 + // LIN64: br i1 %[[FITSINGP]] + // LIN64: %[[BC1:.+]] = phi i92* + // LIN64: %[[LOAD1:.+]] = load i92, i92* %[[BC1]] + // LIN64: store i92 %[[LOAD1]], i92* + + // LIN32: %[[CUR1:.+]] = load i8*, i8** %[[ARGS]] + // LIN32: %[[NEXT1:.+]] = getelementptr inbounds i8, i8* %[[CUR1]], i32 12 + // LIN32: store i8* %[[NEXT1]], i8** %[[ARGS]] + // LIN32: %[[BC1:.+]] = bitcast i8* %[[CUR1]] to i92* + // LIN32: %[[LOADV1:.+]] = load i92, i92* %[[BC1]] + // LIN32: store i92 %[[LOADV1]], i92* + + // WIN64: %[[CUR1:.+]] = load i8*, i8** %[[ARGS]] + // WIN64: %[[NEXT1:.+]] = getelementptr inbounds i8, i8* %[[CUR1]], i64 8 + // WIN64: store i8* %[[NEXT1]], i8** %[[ARGS]] + // WIN64: %[[BC1:.+]] = bitcast i8* %[[CUR1]] to i92** + // WIN64: %[[LOADP1:.+]] = load i92*, i92** %[[BC1]] + // WIN64: %[[LOADV1:.+]] = load i92, i92* %[[LOADP1]] + // WIN64: store i92 %[[LOADV1]], i92* + + // WIN32: %[[CUR1:.+]] = load i8*, i8** %[[ARGS]] + // WIN32: %[[NEXT1:.+]] = getelementptr inbounds i8, i8* %[[CUR1]], i32 16 + // WIN32: store i8* %[[NEXT1]], i8** %[[ARGS]] + // WIN32: %[[BC1:.+]] = bitcast i8* %[[CUR1]] to i92* + // WIN32: %[[LOADV1:.+]] = load i92, i92* %[[BC1]] + // WIN32: store i92 %[[LOADV1]], i92* + _ExtInt(31) B = __builtin_va_arg(args, _ExtInt(31)); - // LIN: %[[AD2:.+]] = getelementptr inbounds [1 x %struct.__va_list_tag], [1 x %struct.__va_list_tag]* %[[ARGS]] - // LIN: %[[OFA_P2:.+]] = getelementptr inbounds %struct.__va_list_tag, %struct.__va_list_tag* %[[AD2]], i32 0, i32 0 - // LIN: %[[GPOFFSET:.+]] = load i32, i32* %[[OFA_P2]] - // LIN: %[[FITSINGP:.+]] = icmp ule i32 %[[GPOFFSET]], 40 - // LIN: br i1 %[[FITSINGP]] - // LIN: %[[BC1:.+]] = phi i31* - // LIN: %[[LOAD1:.+]] = load i31, i31* %[[BC1]] - // LIN: store i31 %[[LOAD1]], i31* - - // WIN: %[[CUR2:.+]] = load i8*, i8** %[[ARGS]] - // WIN: %[[NEXT2:.+]] = getelementptr inbounds i8, i8* %[[CUR2]], i64 8 - // WIN: store i8* %[[NEXT2]], i8** %[[ARGS]] - // WIN: %[[BC2:.+]] = bitcast i8* %[[CUR2]] to i31* - // WIN: %[[LOADV2:.+]] = load i31, i31* %[[BC2]] - // WIN: store i31 %[[LOADV2]], i31* + // LIN64: %[[AD2:.+]] = getelementptr inbounds [1 x %struct.__va_list_tag], [1 x %struct.__va_list_tag]* %[[ARGS]] + // LIN64: %[[OFA_P2:.+]] = getelementptr inbounds %struct.__va_list_tag, %struct.__va_list_tag* %[[AD2]], i32 0, i32 0 + // LIN64: %[[GPOFFSET:.+]] = load i32, i32* %[[OFA_P2]] + // LIN64: %[[FITSINGP:.+]] = icmp ule i32 %[[GPOFFSET]], 40 + // LIN64: br i1 %[[FITSINGP]] + // LIN64: %[[BC1:.+]] = phi i31* + // LIN64: %[[LOAD1:.+]] = load i31, i31* %[[BC1]] + // LIN64: store i31 %[[LOAD1]], i31* + + // LIN32: %[[CUR2:.+]] = load i8*, i8** %[[ARGS]] + // LIN32: %[[NEXT2:.+]] = getelementptr inbounds i8, i8* %[[CUR2]], i32 4 + // LIN32: store i8* %[[NEXT2]], i8** %[[ARGS]] + // LIN32: %[[BC2:.+]] = bitcast i8* %[[CUR2]] to i31* + // LIN32: %[[LOADV2:.+]] = load i31, i31* %[[BC2]] + // LIN32: store i31 %[[LOADV2]], i31* + + // WIN64: %[[CUR2:.+]] = load i8*, i8** %[[ARGS]] + // WIN64: %[[NEXT2:.+]] = getelementptr inbounds i8, i8* %[[CUR2]], i64 8 + // WIN64: store i8* %[[NEXT2]], i8** %[[ARGS]] + // WIN64: %[[BC2:.+]] = bitcast i8* %[[CUR2]] to i31* + // WIN64: %[[LOADV2:.+]] = load i31, i31* %[[BC2]] + // WIN64: store i31 %[[LOADV2]], i31* + + // WIN32: %[[CUR2:.+]] = load i8*, i8** %[[ARGS]] + // WIN32: %[[NEXT2:.+]] = getelementptr inbounds i8, i8* %[[CUR2]], i32 4 + // WIN32: store i8* %[[NEXT2]], i8** %[[ARGS]] + // WIN32: %[[BC2:.+]] = bitcast i8* %[[CUR2]] to i31* + // WIN32: %[[LOADV2:.+]] = load i31, i31* %[[BC2]] + // WIN32: store i31 %[[LOADV2]], i31* _ExtInt(16) C = __builtin_va_arg(args, _ExtInt(16)); - // LIN: %[[AD3:.+]] = getelementptr inbounds [1 x %struct.__va_list_tag], [1 x %struct.__va_list_tag]* %[[ARGS]] - // LIN: %[[OFA_P3:.+]] = getelementptr inbounds %struct.__va_list_tag, %struct.__va_list_tag* %[[AD3]], i32 0, i32 0 - // LIN: %[[GPOFFSET:.+]] = load i32, i32* %[[OFA_P3]] - // LIN: %[[FITSINGP:.+]] = icmp ule i32 %[[GPOFFSET]], 40 - // LIN: br i1 %[[FITSINGP]] - // LIN: %[[BC1:.+]] = phi i16* - // LIN: %[[LOAD1:.+]] = load i16, i16* %[[BC1]] - // LIN: store i16 %[[LOAD1]], i16* - - // WIN: %[[CUR3:.+]] = load i8*, i8** %[[ARGS]] - // WIN: %[[NEXT3:.+]] = getelementptr inbounds i8, i8* %[[CUR3]], i64 8 - // WIN: store i8* %[[NEXT3]], i8** %[[ARGS]] - // WIN: %[[BC3:.+]] = bitcast i8* %[[CUR3]] to i16* - // WIN: %[[LOADV3:.+]] = load i16, i16* %[[BC3]] - // WIN: store i16 %[[LOADV3]], i16* + // LIN64: %[[AD3:.+]] = getelementptr inbounds [1 x %struct.__va_list_tag], [1 x %struct.__va_list_tag]* %[[ARGS]] + // LIN64: %[[OFA_P3:.+]] = getelementptr inbounds %struct.__va_list_tag, %struct.__va_list_tag* %[[AD3]], i32 0, i32 0 + // LIN64: %[[GPOFFSET:.+]] = load i32, i32* %[[OFA_P3]] + // LIN64: %[[FITSINGP:.+]] = icmp ule i32 %[[GPOFFSET]], 40 + // LIN64: br i1 %[[FITSINGP]] + // LIN64: %[[BC1:.+]] = phi i16* + // LIN64: %[[LOAD1:.+]] = load i16, i16* %[[BC1]] + // LIN64: store i16 %[[LOAD1]], i16* + + // LIN32: %[[CUR3:.+]] = load i8*, i8** %[[ARGS]] + // LIN32: %[[NEXT3:.+]] = getelementptr inbounds i8, i8* %[[CUR3]], i32 4 + // LIN32: store i8* %[[NEXT3]], i8** %[[ARGS]] + // LIN32: %[[BC3:.+]] = bitcast i8* %[[CUR3]] to i16* + // LIN32: %[[LOADV3:.+]] = load i16, i16* %[[BC3]] + // LIN32: store i16 %[[LOADV3]], i16* + + // WIN64: %[[CUR3:.+]] = load i8*, i8** %[[ARGS]] + // WIN64: %[[NEXT3:.+]] = getelementptr inbounds i8, i8* %[[CUR3]], i64 8 + // WIN64: store i8* %[[NEXT3]], i8** %[[ARGS]] + // WIN64: %[[BC3:.+]] = bitcast i8* %[[CUR3]] to i16* + // WIN64: %[[LOADV3:.+]] = load i16, i16* %[[BC3]] + // WIN64: store i16 %[[LOADV3]], i16* + + // WIN32: %[[CUR3:.+]] = load i8*, i8** %[[ARGS]] + // WIN32: %[[NEXT3:.+]] = getelementptr inbounds i8, i8* %[[CUR3]], i32 4 + // WIN32: store i8* %[[NEXT3]], i8** %[[ARGS]] + // WIN32: %[[BC3:.+]] = bitcast i8* %[[CUR3]] to i16* + // WIN32: %[[LOADV3:.+]] = load i16, i16* %[[BC3]] + // WIN32: store i16 %[[LOADV3]], i16* + _ExtInt(129) D = __builtin_va_arg(args, _ExtInt(129)); - // LIN: %[[AD4:.+]] = getelementptr inbounds [1 x %struct.__va_list_tag], [1 x %struct.__va_list_tag]* %[[ARGS]] - // LIN: %[[OFA_P4:.+]] = getelementptr inbounds %struct.__va_list_tag, %struct.__va_list_tag* %[[AD4]], i32 0, i32 2 - // LIN: %[[OFA4:.+]] = load i8*, i8** %[[OFA_P4]] - // LIN: %[[BC4:.+]] = bitcast i8* %[[OFA4]] to i129* - // LIN: %[[OFANEXT4:.+]] = getelementptr i8, i8* %[[OFA4]], i32 24 - // LIN: store i8* %[[OFANEXT4]], i8** %[[OFA_P4]] - // LIN: %[[LOAD4:.+]] = load i129, i129* %[[BC4]] - // LIN: store i129 %[[LOAD4]], i129* - - // WIN: %[[CUR4:.+]] = load i8*, i8** %[[ARGS]] - // WIN: %[[NEXT4:.+]] = getelementptr inbounds i8, i8* %[[CUR4]], i64 8 - // WIN: store i8* %[[NEXT4]], i8** %[[ARGS]] - // WIN: %[[BC4:.+]] = bitcast i8* %[[CUR4]] to i129** - // WIN: %[[LOADP4:.+]] = load i129*, i129** %[[BC4]] - // WIN: %[[LOADV4:.+]] = load i129, i129* %[[LOADP4]] - // WIN: store i129 %[[LOADV4]], i129* + // LIN64: %[[AD4:.+]] = getelementptr inbounds [1 x %struct.__va_list_tag], [1 x %struct.__va_list_tag]* %[[ARGS]] + // LIN64: %[[OFA_P4:.+]] = getelementptr inbounds %struct.__va_list_tag, %struct.__va_list_tag* %[[AD4]], i32 0, i32 2 + // LIN64: %[[OFA4:.+]] = load i8*, i8** %[[OFA_P4]] + // LIN64: %[[BC4:.+]] = bitcast i8* %[[OFA4]] to i129* + // LIN64: %[[OFANEXT4:.+]] = getelementptr i8, i8* %[[OFA4]], i32 24 + // LIN64: store i8* %[[OFANEXT4]], i8** %[[OFA_P4]] + // LIN64: %[[LOAD4:.+]] = load i129, i129* %[[BC4]] + // LIN64: store i129 %[[LOAD4]], i129* + + // LIN32: %[[CUR4:.+]] = load i8*, i8** %[[ARGS]] + // LIN32: %[[NEXT4:.+]] = getelementptr inbounds i8, i8* %[[CUR4]], i32 20 + // LIN32: store i8* %[[NEXT4]], i8** %[[ARGS]] + // LIN32: %[[BC4:.+]] = bitcast i8* %[[CUR4]] to i129* + // LIN32: %[[LOADV4:.+]] = load i129, i129* %[[BC4]] + // LIN32: store i129 %[[LOADV4]], i129* + + // WIN64: %[[CUR4:.+]] = load i8*, i8** %[[ARGS]] + // WIN64: %[[NEXT4:.+]] = getelementptr inbounds i8, i8* %[[CUR4]], i64 8 + // WIN64: store i8* %[[NEXT4]], i8** %[[ARGS]] + // WIN64: %[[BC4:.+]] = bitcast i8* %[[CUR4]] to i129** + // WIN64: %[[LOADP4:.+]] = load i129*, i129** %[[BC4]] + // WIN64: %[[LOADV4:.+]] = load i129, i129* %[[LOADP4]] + // WIN64: store i129 %[[LOADV4]], i129* + + // WIN32: %[[CUR4:.+]] = load i8*, i8** %[[ARGS]] + // WIN32: %[[NEXT4:.+]] = getelementptr inbounds i8, i8* %[[CUR4]], i32 24 + // WIN32: store i8* %[[NEXT4]], i8** %[[ARGS]] + // WIN32: %[[BC4:.+]] = bitcast i8* %[[CUR4]] to i129* + // WIN32: %[[LOADV4:.+]] = load i129, i129* %[[BC4]] + // WIN32: store i129 %[[LOADV4]], i129* _ExtInt(8388600) E = __builtin_va_arg(args, _ExtInt(8388600)); - // LIN: %[[AD5:.+]] = getelementptr inbounds [1 x %struct.__va_list_tag], [1 x %struct.__va_list_tag]* %[[ARGS]] - // LIN: %[[OFA_P5:.+]] = getelementptr inbounds %struct.__va_list_tag, %struct.__va_list_tag* %[[AD5]], i32 0, i32 2 - // LIN: %[[OFA5:.+]] = load i8*, i8** %[[OFA_P5]] - // LIN: %[[BC5:.+]] = bitcast i8* %[[OFA5]] to i8388600* - // LIN: %[[OFANEXT5:.+]] = getelementptr i8, i8* %[[OFA5]], i32 1048576 - // LIN: store i8* %[[OFANEXT5]], i8** %[[OFA_P5]] - // LIN: %[[LOAD5:.+]] = load i8388600, i8388600* %[[BC5]] - // LIN: store i8388600 %[[LOAD5]], i8388600* - - // WIN: %[[CUR5:.+]] = load i8*, i8** %[[ARGS]] - // WIN: %[[NEXT5:.+]] = getelementptr inbounds i8, i8* %[[CUR5]], i64 8 - // WIN: store i8* %[[NEXT5]], i8** %[[ARGS]] - // WIN: %[[BC5:.+]] = bitcast i8* %[[CUR5]] to i8388600** - // WIN: %[[LOADP5:.+]] = load i8388600*, i8388600** %[[BC5]] - // WIN: %[[LOADV5:.+]] = load i8388600, i8388600* %[[LOADP5]] - // WIN: store i8388600 %[[LOADV5]], i8388600* + // LIN64: %[[AD5:.+]] = getelementptr inbounds [1 x %struct.__va_list_tag], [1 x %struct.__va_list_tag]* %[[ARGS]] + // LIN64: %[[OFA_P5:.+]] = getelementptr inbounds %struct.__va_list_tag, %struct.__va_list_tag* %[[AD5]], i32 0, i32 2 + // LIN64: %[[OFA5:.+]] = load i8*, i8** %[[OFA_P5]] + // LIN64: %[[BC5:.+]] = bitcast i8* %[[OFA5]] to i8388600* + // LIN64: %[[OFANEXT5:.+]] = getelementptr i8, i8* %[[OFA5]], i32 1048576 + // LIN64: store i8* %[[OFANEXT5]], i8** %[[OFA_P5]] + // LIN64: %[[LOAD5:.+]] = load i8388600, i8388600* %[[BC5]] + // LIN64: store i8388600 %[[LOAD5]], i8388600* + + // LIN32: %[[CUR5:.+]] = load i8*, i8** %[[ARGS]] + // LIN32: %[[NEXT5:.+]] = getelementptr inbounds i8, i8* %[[CUR5]], i32 1048576 + // LIN32: store i8* %[[NEXT5]], i8** %[[ARGS]] + // LIN32: %[[BC5:.+]] = bitcast i8* %[[CUR5]] to i8388600* + // LIN32: %[[LOADV5:.+]] = load i8388600, i8388600* %[[BC5]] + // LIN32: store i8388600 %[[LOADV5]], i8388600* + + // WIN64: %[[CUR5:.+]] = load i8*, i8** %[[ARGS]] + // WIN64: %[[NEXT5:.+]] = getelementptr inbounds i8, i8* %[[CUR5]], i64 8 + // WIN64: store i8* %[[NEXT5]], i8** %[[ARGS]] + // WIN64: %[[BC5:.+]] = bitcast i8* %[[CUR5]] to i8388600** + // WIN64: %[[LOADP5:.+]] = load i8388600*, i8388600** %[[BC5]] + // WIN64: %[[LOADV5:.+]] = load i8388600, i8388600* %[[LOADP5]] + // WIN64: store i8388600 %[[LOADV5]], i8388600* + + // WIN32: %[[CUR5:.+]] = load i8*, i8** %[[ARGS]] + // WIN32: %[[NEXT5:.+]] = getelementptr inbounds i8, i8* %[[CUR5]], i32 1048576 + // WIN32: store i8* %[[NEXT5]], i8** %[[ARGS]] + // WIN32: %[[BC5:.+]] = bitcast i8* %[[CUR5]] to i8388600* + // WIN32: %[[LOADV5:.+]] = load i8388600, i8388600* %[[BC5]] + // WIN32: store i8388600 %[[LOADV5]], i8388600* __builtin_va_end(args); - // LIN: %[[ENDAD:.+]] = getelementptr inbounds [1 x %struct.__va_list_tag], [1 x %struct.__va_list_tag]* %[[ARGS]] - // LIN: %[[ENDAD1:.+]] = bitcast %struct.__va_list_tag* %[[ENDAD]] to i8* - // LIN: call void @llvm.va_end(i8* %[[ENDAD1]]) + // LIN64: %[[ENDAD:.+]] = getelementptr inbounds [1 x %struct.__va_list_tag], [1 x %struct.__va_list_tag]* %[[ARGS]] + // LIN64: %[[ENDAD1:.+]] = bitcast %struct.__va_list_tag* %[[ENDAD]] to i8* + // LIN64: call void @llvm.va_end(i8* %[[ENDAD1]]) + // LIN32: %[[ARGSEND:.+]] = bitcast i8** %[[ARGS]] to i8* + // LIN32: call void @llvm.va_end(i8* %[[ARGSEND]]) // WIN: %[[ARGSEND:.+]] = bitcast i8** %[[ARGS]] to i8* // WIN: call void @llvm.va_end(i8* %[[ARGSEND]]) } @@ -256,23 +345,35 @@ void typeid_tests() { _ExtInt(32) S32_1, S32_2; auto A = typeid(U33_1); - // LIN: call void @_ZNSt9type_infoC1ERKS_(%"class.std::type_info"* {{[^,]*}} %{{.+}}, %"class.std::type_info"* nonnull align 8 dereferenceable(16) bitcast ({ i8*, i8* }* @_ZTIU7_ExtIntILi33EEj to %"class.std::type_info"*)) - // WIN: call %"class.std::type_info"* @"??0type_info@std@@QEAA@AEBV01@@Z"(%"class.std::type_info"* {{[^,]*}} %{{.+}}, %"class.std::type_info"* nonnull align 8 dereferenceable(16) bitcast (%rtti.TypeDescriptor28* @"??_R0U?$_UExtInt@$0CB@@__clang@@@8" to %"class.std::type_info"*)) + // LIN64: call void @_ZNSt9type_infoC1ERKS_(%"class.std::type_info"* {{[^,]*}} %{{.+}}, %"class.std::type_info"* nonnull align 8 dereferenceable(16) bitcast ({ i8*, i8* }* @_ZTIU7_ExtIntILi33EEj to %"class.std::type_info"*)) + // LIN32: call void @_ZNSt9type_infoC1ERKS_(%"class.std::type_info"* {{[^,]*}} %{{.+}}, %"class.std::type_info"* nonnull align 4 dereferenceable(8) bitcast ({ i8*, i8* }* @_ZTIU7_ExtIntILi33EEj to %"class.std::type_info"*)) + // WIN64: call %"class.std::type_info"* @"??0type_info@std@@QEAA@AEBV01@@Z"(%"class.std::type_info"* {{[^,]*}} %{{.+}}, %"class.std::type_info"* nonnull align 8 dereferenceable(16) bitcast (%rtti.TypeDescriptor28* @"??_R0U?$_UExtInt@$0CB@@__clang@@@8" to %"class.std::type_info"*)) + // WIN32: call x86_thiscallcc %"class.std::type_info"* @"??0type_info@std@@QAE@ABV01@@Z"(%"class.std::type_info"* {{[^,]*}} %{{.+}}, %"class.std::type_info"* nonnull align 4 dereferenceable(8) bitcast (%rtti.TypeDescriptor28* @"??_R0U?$_UExtInt@$0CB@@__clang@@@8" to %"class.std::type_info"*)) auto B = typeid(U33_2); - // LIN: call void @_ZNSt9type_infoC1ERKS_(%"class.std::type_info"* {{[^,]*}} %{{.+}}, %"class.std::type_info"* nonnull align 8 dereferenceable(16) bitcast ({ i8*, i8* }* @_ZTIU7_ExtIntILi33EEj to %"class.std::type_info"*)) - // WIN: call %"class.std::type_info"* @"??0type_info@std@@QEAA@AEBV01@@Z"(%"class.std::type_info"* {{[^,]*}} %{{.+}}, %"class.std::type_info"* nonnull align 8 dereferenceable(16) bitcast (%rtti.TypeDescriptor28* @"??_R0U?$_UExtInt@$0CB@@__clang@@@8" to %"class.std::type_info"*)) + // LIN64: call void @_ZNSt9type_infoC1ERKS_(%"class.std::type_info"* {{[^,]*}} %{{.+}}, %"class.std::type_info"* nonnull align 8 dereferenceable(16) bitcast ({ i8*, i8* }* @_ZTIU7_ExtIntILi33EEj to %"class.std::type_info"*)) + // LIN32: call void @_ZNSt9type_infoC1ERKS_(%"class.std::type_info"* {{[^,]*}} %{{.+}}, %"class.std::type_info"* nonnull align 4 dereferenceable(8) bitcast ({ i8*, i8* }* @_ZTIU7_ExtIntILi33EEj to %"class.std::type_info"*)) + // WIN64: call %"class.std::type_info"* @"??0type_info@std@@QEAA@AEBV01@@Z"(%"class.std::type_info"* {{[^,]*}} %{{.+}}, %"class.std::type_info"* nonnull align 8 dereferenceable(16) bitcast (%rtti.TypeDescriptor28* @"??_R0U?$_UExtInt@$0CB@@__clang@@@8" to %"class.std::type_info"*)) + // WIN32: call x86_thiscallcc %"class.std::type_info"* @"??0type_info@std@@QAE@ABV01@@Z"(%"class.std::type_info"* {{[^,]*}} %{{.+}}, %"class.std::type_info"* nonnull align 4 dereferenceable(8) bitcast (%rtti.TypeDescriptor28* @"??_R0U?$_UExtInt@$0CB@@__clang@@@8" to %"class.std::type_info"*)) auto C = typeid(S33_1); - // LIN: call void @_ZNSt9type_infoC1ERKS_(%"class.std::type_info"* {{[^,]*}} %{{.+}}, %"class.std::type_info"* nonnull align 8 dereferenceable(16) bitcast ({ i8*, i8* }* @_ZTIU7_ExtIntILi33EEi to %"class.std::type_info"*)) - // WIN: call %"class.std::type_info"* @"??0type_info@std@@QEAA@AEBV01@@Z"(%"class.std::type_info"* {{[^,]*}} %{{.+}}, %"class.std::type_info"* nonnull align 8 dereferenceable(16) bitcast (%rtti.TypeDescriptor27* @"??_R0U?$_ExtInt@$0CB@@__clang@@@8" to %"class.std::type_info"*)) + // LIN64: call void @_ZNSt9type_infoC1ERKS_(%"class.std::type_info"* {{[^,]*}} %{{.+}}, %"class.std::type_info"* nonnull align 8 dereferenceable(16) bitcast ({ i8*, i8* }* @_ZTIU7_ExtIntILi33EEi to %"class.std::type_info"*)) + // LIN32: call void @_ZNSt9type_infoC1ERKS_(%"class.std::type_info"* {{[^,]*}} %{{.+}}, %"class.std::type_info"* nonnull align 4 dereferenceable(8) bitcast ({ i8*, i8* }* @_ZTIU7_ExtIntILi33EEi to %"class.std::type_info"*)) + // WIN64: call %"class.std::type_info"* @"??0type_info@std@@QEAA@AEBV01@@Z"(%"class.std::type_info"* {{[^,]*}} %{{.+}}, %"class.std::type_info"* nonnull align 8 dereferenceable(16) bitcast (%rtti.TypeDescriptor27* @"??_R0U?$_ExtInt@$0CB@@__clang@@@8" to %"class.std::type_info"*)) + // WIN32: call x86_thiscallcc %"class.std::type_info"* @"??0type_info@std@@QAE@ABV01@@Z"(%"class.std::type_info"* {{[^,]*}} %{{.+}}, %"class.std::type_info"* nonnull align 4 dereferenceable(8) bitcast (%rtti.TypeDescriptor27* @"??_R0U?$_ExtInt@$0CB@@__clang@@@8" to %"class.std::type_info"*)) auto D = typeid(S33_2); - // LIN: call void @_ZNSt9type_infoC1ERKS_(%"class.std::type_info"* {{[^,]*}} %{{.+}}, %"class.std::type_info"* nonnull align 8 dereferenceable(16) bitcast ({ i8*, i8* }* @_ZTIU7_ExtIntILi33EEi to %"class.std::type_info"*)) - // WIN: call %"class.std::type_info"* @"??0type_info@std@@QEAA@AEBV01@@Z"(%"class.std::type_info"* {{[^,]*}} %{{.+}}, %"class.std::type_info"* nonnull align 8 dereferenceable(16) bitcast (%rtti.TypeDescriptor27* @"??_R0U?$_ExtInt@$0CB@@__clang@@@8" to %"class.std::type_info"*)) + // LIN64: call void @_ZNSt9type_infoC1ERKS_(%"class.std::type_info"* {{[^,]*}} %{{.+}}, %"class.std::type_info"* nonnull align 8 dereferenceable(16) bitcast ({ i8*, i8* }* @_ZTIU7_ExtIntILi33EEi to %"class.std::type_info"*)) + // LIN32: call void @_ZNSt9type_infoC1ERKS_(%"class.std::type_info"* {{[^,]*}} %{{.+}}, %"class.std::type_info"* nonnull align 4 dereferenceable(8) bitcast ({ i8*, i8* }* @_ZTIU7_ExtIntILi33EEi to %"class.std::type_info"*)) + // WIN64: call %"class.std::type_info"* @"??0type_info@std@@QEAA@AEBV01@@Z"(%"class.std::type_info"* {{[^,]*}} %{{.+}}, %"class.std::type_info"* nonnull align 8 dereferenceable(16) bitcast (%rtti.TypeDescriptor27* @"??_R0U?$_ExtInt@$0CB@@__clang@@@8" to %"class.std::type_info"*)) + // WIN32: call x86_thiscallcc %"class.std::type_info"* @"??0type_info@std@@QAE@ABV01@@Z"(%"class.std::type_info"* {{[^,]*}} %{{.+}}, %"class.std::type_info"* nonnull align 4 dereferenceable(8) bitcast (%rtti.TypeDescriptor27* @"??_R0U?$_ExtInt@$0CB@@__clang@@@8" to %"class.std::type_info"*)) auto E = typeid(S32_1); - // LIN: call void @_ZNSt9type_infoC1ERKS_(%"class.std::type_info"* {{[^,]*}} %{{.+}}, %"class.std::type_info"* nonnull align 8 dereferenceable(16) bitcast ({ i8*, i8* }* @_ZTIU7_ExtIntILi32EEi to %"class.std::type_info"*)) - // WIN: call %"class.std::type_info"* @"??0type_info@std@@QEAA@AEBV01@@Z"(%"class.std::type_info"* {{[^,]*}} %{{.+}}, %"class.std::type_info"* nonnull align 8 dereferenceable(16) bitcast (%rtti.TypeDescriptor27* @"??_R0U?$_ExtInt@$0CA@@__clang@@@8" to %"class.std::type_info"*)) + // LIN64: call void @_ZNSt9type_infoC1ERKS_(%"class.std::type_info"* {{[^,]*}} %{{.+}}, %"class.std::type_info"* nonnull align 8 dereferenceable(16) bitcast ({ i8*, i8* }* @_ZTIU7_ExtIntILi32EEi to %"class.std::type_info"*)) + // LIN32: call void @_ZNSt9type_infoC1ERKS_(%"class.std::type_info"* {{[^,]*}} %{{.+}}, %"class.std::type_info"* nonnull align 4 dereferenceable(8) bitcast ({ i8*, i8* }* @_ZTIU7_ExtIntILi32EEi to %"class.std::type_info"*)) + // WIN64: call %"class.std::type_info"* @"??0type_info@std@@QEAA@AEBV01@@Z"(%"class.std::type_info"* {{[^,]*}} %{{.+}}, %"class.std::type_info"* nonnull align 8 dereferenceable(16) bitcast (%rtti.TypeDescriptor27* @"??_R0U?$_ExtInt@$0CA@@__clang@@@8" to %"class.std::type_info"*)) + // WIN32: call x86_thiscallcc %"class.std::type_info"* @"??0type_info@std@@QAE@ABV01@@Z"(%"class.std::type_info"* {{[^,]*}} %{{.+}}, %"class.std::type_info"* nonnull align 4 dereferenceable(8) bitcast (%rtti.TypeDescriptor27* @"??_R0U?$_ExtInt@$0CA@@__clang@@@8" to %"class.std::type_info"*)) auto F = typeid(S32_2); - // LIN: call void @_ZNSt9type_infoC1ERKS_(%"class.std::type_info"* {{[^,]*}} %{{.+}}, %"class.std::type_info"* nonnull align 8 dereferenceable(16) bitcast ({ i8*, i8* }* @_ZTIU7_ExtIntILi32EEi to %"class.std::type_info"*)) - // WIN: call %"class.std::type_info"* @"??0type_info@std@@QEAA@AEBV01@@Z"(%"class.std::type_info"* {{[^,]*}} %{{.+}}, %"class.std::type_info"* nonnull align 8 dereferenceable(16) bitcast (%rtti.TypeDescriptor27* @"??_R0U?$_ExtInt@$0CA@@__clang@@@8" to %"class.std::type_info"*)) + // LIN64: call void @_ZNSt9type_infoC1ERKS_(%"class.std::type_info"* {{[^,]*}} %{{.+}}, %"class.std::type_info"* nonnull align 8 dereferenceable(16) bitcast ({ i8*, i8* }* @_ZTIU7_ExtIntILi32EEi to %"class.std::type_info"*)) + // LIN32: call void @_ZNSt9type_infoC1ERKS_(%"class.std::type_info"* {{[^,]*}} %{{.+}}, %"class.std::type_info"* nonnull align 4 dereferenceable(8) bitcast ({ i8*, i8* }* @_ZTIU7_ExtIntILi32EEi to %"class.std::type_info"*)) + // WIN64: call %"class.std::type_info"* @"??0type_info@std@@QEAA@AEBV01@@Z"(%"class.std::type_info"* {{[^,]*}} %{{.+}}, %"class.std::type_info"* nonnull align 8 dereferenceable(16) bitcast (%rtti.TypeDescriptor27* @"??_R0U?$_ExtInt@$0CA@@__clang@@@8" to %"class.std::type_info"*)) + // WIN32: call x86_thiscallcc %"class.std::type_info"* @"??0type_info@std@@QAE@ABV01@@Z"(%"class.std::type_info"* {{[^,]*}} %{{.+}}, %"class.std::type_info"* nonnull align 4 dereferenceable(8) bitcast (%rtti.TypeDescriptor27* @"??_R0U?$_ExtInt@$0CA@@__clang@@@8" to %"class.std::type_info"*)) } void ExplicitCasts() { @@ -304,11 +405,15 @@ void OffsetOfTest() { // WIN: define dso_local void @"?OffsetOfTest@@YAXXZ"() auto A = __builtin_offsetof(S,A); - // CHECK: store i64 0, i64* %{{.+}} + // CHECK: store i{{.+}} 0, i{{.+}}* %{{.+}} auto B = __builtin_offsetof(S,B); - // CHECK: store i64 8, i64* %{{.+}} + // LIN64: store i{{.+}} 8, i{{.+}}* %{{.+}} + // LIN32: store i{{.+}} 4, i{{.+}}* %{{.+}} + // WIN: store i{{.+}} 8, i{{.+}}* %{{.+}} auto C = __builtin_offsetof(S,C); - // CHECK: store i64 1048584, i64* %{{.+}} + // LIN64: store i{{.+}} 1048584, i{{.+}}* %{{.+}} + // LIN32: store i{{.+}} 1048580, i{{.+}}* %{{.+}} + // WIN: store i{{.+}} 1048584, i{{.+}}* %{{.+}} } _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits