From 4aaa77e48dd1bd8337d5a4fe9795f13c54f3a9cb Mon Sep 17 00:00:00 2001 From: Jonas Devlieghere Date: Fri, 13 Sep 2019 05:16:59 +0000 Subject: [PATCH] Revert "For PR17164: split -fno-lax-vector-conversion into three different" This breaks the LLDB build. I tried reaching out to Richard, but haven't gotten a reply yet. llvm-svn: 371813 --- clang/include/clang/Basic/LangOptions.def | 3 +- clang/include/clang/Basic/LangOptions.h | 10 --- clang/include/clang/Driver/Options.td | 7 +- clang/lib/Driver/ToolChains/Clang.cpp | 6 +- clang/lib/Frontend/CompilerInvocation.cpp | 16 +---- clang/lib/Sema/SemaExpr.cpp | 22 +----- clang/test/CodeGen/builtins-systemz-vector.c | 2 +- clang/test/CodeGen/builtins-systemz-vector2.c | 2 +- clang/test/CodeGen/builtins-systemz-vector3.c | 2 +- .../test/CodeGen/builtins-systemz-zvector-error.c | 2 +- clang/test/CodeGen/builtins-systemz-zvector.c | 4 +- .../test/CodeGen/builtins-systemz-zvector2-error.c | 2 +- clang/test/CodeGen/builtins-systemz-zvector2.c | 4 +- .../test/CodeGen/builtins-systemz-zvector3-error.c | 2 +- clang/test/CodeGen/builtins-systemz-zvector3.c | 4 +- clang/test/CodeGen/builtins-wasm.c | 6 +- clang/test/CodeGenCXX/builtins-systemz-zvector.cpp | 2 +- clang/test/Headers/altivec-header.c | 2 +- clang/test/Headers/arm-neon-header.c | 2 +- .../test/Headers/x86-intrinsics-headers-clean.cpp | 2 +- clang/test/Headers/x86-intrinsics-headers.c | 2 +- clang/test/Headers/x86intrin-2.c | 2 +- clang/test/Headers/x86intrin.c | 2 +- clang/test/Sema/ext_vector_casts.c | 2 +- clang/test/Sema/typedef-retain.c | 2 +- clang/test/Sema/zvector.c | 2 +- clang/test/Sema/zvector2.c | 2 +- clang/test/SemaCXX/altivec.cpp | 2 +- clang/test/SemaCXX/vector-no-lax.cpp | 2 +- clang/test/SemaCXX/vector.cpp | 82 ++++++---------------- 30 files changed, 60 insertions(+), 142 deletions(-) diff --git a/clang/include/clang/Basic/LangOptions.def b/clang/include/clang/Basic/LangOptions.def index 6b497a0..dec281e 100644 --- a/clang/include/clang/Basic/LangOptions.def +++ b/clang/include/clang/Basic/LangOptions.def @@ -119,8 +119,7 @@ LANGOPT(AppleKext , 1, 0, "Apple kext support") BENIGN_LANGOPT(PascalStrings, 1, 0, "Pascal string support") LANGOPT(WritableStrings , 1, 0, "writable string support") LANGOPT(ConstStrings , 1, 0, "const-qualified string support") -ENUM_LANGOPT(LaxVectorConversions, LaxVectorConversionKind, 2, - LaxVectorConversionKind::All, "lax vector conversions") +LANGOPT(LaxVectorConversions , 1, 1, "lax vector conversions") LANGOPT(AltiVec , 1, 0, "AltiVec-style vector initializers") LANGOPT(ZVector , 1, 0, "System z vector extensions") LANGOPT(Exceptions , 1, 0, "exception handling") diff --git a/clang/include/clang/Basic/LangOptions.h b/clang/include/clang/Basic/LangOptions.h index 5f808f0..e3b7737 100644 --- a/clang/include/clang/Basic/LangOptions.h +++ b/clang/include/clang/Basic/LangOptions.h @@ -184,16 +184,6 @@ public: FEA_On }; - enum class LaxVectorConversionKind { - /// Permit no implicit vector bitcasts. - None, - /// Permit vector bitcasts between integer vectors with different numbers - /// of elements but the same total bit-width. - Integer, - /// Permit vector bitcasts between all vectors with the same total - /// bit-width. - All, - }; public: /// Set of enabled sanitizers. diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td index 7423f92..57bab1e 100644 --- a/clang/include/clang/Driver/Options.td +++ b/clang/include/clang/Driver/Options.td @@ -1274,10 +1274,7 @@ def fno_fine_grained_bitfield_accesses : Flag<["-"], HelpText<"Use large-integer access for consecutive bitfield runs.">; def flat__namespace : Flag<["-"], "flat_namespace">; -def flax_vector_conversions_EQ : Joined<["-"], "flax-vector-conversions=">, Group, - HelpText<"Enable implicit vector bit-casts">, Values<"none,integer,all">, Flags<[CC1Option]>; -def flax_vector_conversions : Flag<["-"], "flax-vector-conversions">, Group, - Alias, AliasArgs<["integer"]>; +def flax_vector_conversions : Flag<["-"], "flax-vector-conversions">, Group; def flimited_precision_EQ : Joined<["-"], "flimited-precision=">, Group; def fapple_link_rtlib : Flag<["-"], "fapple-link-rtlib">, Group, HelpText<"Force linking the clang builtins runtime library">; @@ -1451,7 +1448,7 @@ def fno_experimental_new_pass_manager : Flag<["-"], "fno-experimental-new-pass-m def fveclib : Joined<["-"], "fveclib=">, Group, Flags<[CC1Option]>, HelpText<"Use the given vector functions library">, Values<"Accelerate,MASSV,SVML,none">; def fno_lax_vector_conversions : Flag<["-"], "fno-lax-vector-conversions">, Group, - Alias, AliasArgs<["none"]>; + HelpText<"Disallow implicit conversions between vectors with a different number of elements or different element types">, Flags<[CC1Option]>; def fno_merge_all_constants : Flag<["-"], "fno-merge-all-constants">, Group, HelpText<"Disallow merging of constants">; def fno_modules : Flag <["-"], "fno-modules">, Group, diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp index c39c1c7..6aff423 100644 --- a/clang/lib/Driver/ToolChains/Clang.cpp +++ b/clang/lib/Driver/ToolChains/Clang.cpp @@ -4678,11 +4678,15 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, if (TC.SupportsProfiling()) Args.AddLastArg(CmdArgs, options::OPT_mfentry); + // -flax-vector-conversions is default. + if (!Args.hasFlag(options::OPT_flax_vector_conversions, + options::OPT_fno_lax_vector_conversions)) + CmdArgs.push_back("-fno-lax-vector-conversions"); + if (Args.getLastArg(options::OPT_fapple_kext) || (Args.hasArg(options::OPT_mkernel) && types::isCXX(InputType))) CmdArgs.push_back("-fapple-kext"); - Args.AddLastArg(CmdArgs, options::OPT_flax_vector_conversions_EQ); Args.AddLastArg(CmdArgs, options::OPT_fobjc_sender_dependent_dispatch); Args.AddLastArg(CmdArgs, options::OPT_fdiagnostics_print_source_range_info); Args.AddLastArg(CmdArgs, options::OPT_fdiagnostics_parseable_fixits); diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index 0e29e6d..3db0b88 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -2265,7 +2265,7 @@ void CompilerInvocation::setLangDefaults(LangOptions &Opts, InputKind IK, if (Opts.OpenCL) { Opts.AltiVec = 0; Opts.ZVector = 0; - Opts.setLaxVectorConversions(LangOptions::LaxVectorConversionKind::None); + Opts.LaxVectorConversions = 0; Opts.setDefaultFPContractMode(LangOptions::FPC_On); Opts.NativeHalfType = 1; Opts.NativeHalfArgsAndReturns = 1; @@ -2667,18 +2667,8 @@ static void ParseLangArgs(LangOptions &Opts, ArgList &Args, InputKind IK, Opts.WritableStrings = Args.hasArg(OPT_fwritable_strings); Opts.ConstStrings = Args.hasFlag(OPT_fconst_strings, OPT_fno_const_strings, Opts.ConstStrings); - if (Arg *A = Args.getLastArg(OPT_flax_vector_conversions_EQ)) { - using LaxKind = LangOptions::LaxVectorConversionKind; - if (auto Kind = llvm::StringSwitch>(A->getValue()) - .Case("none", LaxKind::None) - .Case("integer", LaxKind::Integer) - .Case("all", LaxKind::All) - .Default(llvm::None)) - Opts.setLaxVectorConversions(*Kind); - else - Diags.Report(diag::err_drv_invalid_value) - << A->getAsString(Args) << A->getValue(); - } + if (Args.hasArg(OPT_fno_lax_vector_conversions)) + Opts.LaxVectorConversions = 0; if (Args.hasArg(OPT_fno_threadsafe_statics)) Opts.ThreadsafeStatics = 0; Opts.Exceptions = Args.hasArg(OPT_fexceptions); diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index 8452005..8492984 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/lib/Sema/SemaExpr.cpp @@ -6498,28 +6498,8 @@ bool Sema::areLaxCompatibleVectorTypes(QualType srcTy, QualType destTy) { bool Sema::isLaxVectorConversion(QualType srcTy, QualType destTy) { assert(destTy->isVectorType() || srcTy->isVectorType()); - switch (Context.getLangOpts().getLaxVectorConversions()) { - case LangOptions::LaxVectorConversionKind::None: + if (!Context.getLangOpts().LaxVectorConversions) return false; - - case LangOptions::LaxVectorConversionKind::Integer: - if (!srcTy->isIntegralOrEnumerationType()) { - auto *Vec = srcTy->getAs(); - if (!Vec || !Vec->getElementType()->isIntegralOrEnumerationType()) - return false; - } - if (!destTy->isIntegralOrEnumerationType()) { - auto *Vec = destTy->getAs(); - if (!Vec || !Vec->getElementType()->isIntegralOrEnumerationType()) - return false; - } - // OK, integer (vector) -> integer (vector) bitcast. - break; - - case LangOptions::LaxVectorConversionKind::All: - break; - } - return areLaxCompatibleVectorTypes(srcTy, destTy); } diff --git a/clang/test/CodeGen/builtins-systemz-vector.c b/clang/test/CodeGen/builtins-systemz-vector.c index 85cdc30..6d94cfa 100644 --- a/clang/test/CodeGen/builtins-systemz-vector.c +++ b/clang/test/CodeGen/builtins-systemz-vector.c @@ -1,5 +1,5 @@ // REQUIRES: systemz-registered-target -// RUN: %clang_cc1 -target-cpu z13 -triple s390x-ibm-linux -flax-vector-conversions=none \ +// RUN: %clang_cc1 -target-cpu z13 -triple s390x-ibm-linux -fno-lax-vector-conversions \ // RUN: -Wall -Wno-unused -Werror -emit-llvm %s -o - | FileCheck %s typedef __attribute__((vector_size(16))) signed char vec_schar; diff --git a/clang/test/CodeGen/builtins-systemz-vector2.c b/clang/test/CodeGen/builtins-systemz-vector2.c index a17cdf0..8f0b8ae 100644 --- a/clang/test/CodeGen/builtins-systemz-vector2.c +++ b/clang/test/CodeGen/builtins-systemz-vector2.c @@ -1,5 +1,5 @@ // REQUIRES: systemz-registered-target -// RUN: %clang_cc1 -target-cpu z14 -triple s390x-ibm-linux -flax-vector-conversions=none \ +// RUN: %clang_cc1 -target-cpu z14 -triple s390x-ibm-linux -fno-lax-vector-conversions \ // RUN: -Wall -Wno-unused -Werror -emit-llvm %s -o - | FileCheck %s typedef __attribute__((vector_size(16))) signed char vec_schar; diff --git a/clang/test/CodeGen/builtins-systemz-vector3.c b/clang/test/CodeGen/builtins-systemz-vector3.c index e8194b6..976a3e2 100644 --- a/clang/test/CodeGen/builtins-systemz-vector3.c +++ b/clang/test/CodeGen/builtins-systemz-vector3.c @@ -1,5 +1,5 @@ // REQUIRES: systemz-registered-target -// RUN: %clang_cc1 -target-cpu arch13 -triple s390x-ibm-linux -flax-vector-conversions=none \ +// RUN: %clang_cc1 -target-cpu arch13 -triple s390x-ibm-linux -fno-lax-vector-conversions \ // RUN: -Wall -Wno-unused -Werror -emit-llvm %s -o - | FileCheck %s typedef __attribute__((vector_size(16))) signed char vec_schar; diff --git a/clang/test/CodeGen/builtins-systemz-zvector-error.c b/clang/test/CodeGen/builtins-systemz-zvector-error.c index 5fdcb40..cb60ea4 100644 --- a/clang/test/CodeGen/builtins-systemz-zvector-error.c +++ b/clang/test/CodeGen/builtins-systemz-zvector-error.c @@ -1,6 +1,6 @@ // REQUIRES: systemz-registered-target // RUN: %clang_cc1 -target-cpu z13 -triple s390x-linux-gnu \ -// RUN: -fzvector -flax-vector-conversions=none \ +// RUN: -fzvector -fno-lax-vector-conversions \ // RUN: -Wall -Wno-unused -Werror -fsyntax-only -verify %s #include diff --git a/clang/test/CodeGen/builtins-systemz-zvector.c b/clang/test/CodeGen/builtins-systemz-zvector.c index 37a6e4d..f814547 100644 --- a/clang/test/CodeGen/builtins-systemz-zvector.c +++ b/clang/test/CodeGen/builtins-systemz-zvector.c @@ -1,9 +1,9 @@ // REQUIRES: systemz-registered-target // RUN: %clang_cc1 -target-cpu z13 -triple s390x-linux-gnu \ -// RUN: -O -fzvector -flax-vector-conversions=none \ +// RUN: -O -fzvector -fno-lax-vector-conversions \ // RUN: -Wall -Wno-unused -Werror -emit-llvm %s -o - | FileCheck %s // RUN: %clang_cc1 -target-cpu z13 -triple s390x-linux-gnu \ -// RUN: -O -fzvector -flax-vector-conversions=none \ +// RUN: -O -fzvector -fno-lax-vector-conversions \ // RUN: -Wall -Wno-unused -Werror -S %s -o - | FileCheck %s --check-prefix=CHECK-ASM #include diff --git a/clang/test/CodeGen/builtins-systemz-zvector2-error.c b/clang/test/CodeGen/builtins-systemz-zvector2-error.c index 64fcbc4..3b890b9 100644 --- a/clang/test/CodeGen/builtins-systemz-zvector2-error.c +++ b/clang/test/CodeGen/builtins-systemz-zvector2-error.c @@ -1,6 +1,6 @@ // REQUIRES: systemz-registered-target // RUN: %clang_cc1 -target-cpu z14 -triple s390x-linux-gnu \ -// RUN: -fzvector -flax-vector-conversions=none \ +// RUN: -fzvector -fno-lax-vector-conversions \ // RUN: -Wall -Wno-unused -Werror -fsyntax-only -verify %s #include diff --git a/clang/test/CodeGen/builtins-systemz-zvector2.c b/clang/test/CodeGen/builtins-systemz-zvector2.c index 02fa325..990e4e5 100644 --- a/clang/test/CodeGen/builtins-systemz-zvector2.c +++ b/clang/test/CodeGen/builtins-systemz-zvector2.c @@ -1,9 +1,9 @@ // REQUIRES: systemz-registered-target // RUN: %clang_cc1 -target-cpu z14 -triple s390x-linux-gnu \ -// RUN: -O -fzvector -flax-vector-conversions=none \ +// RUN: -O -fzvector -fno-lax-vector-conversions \ // RUN: -Wall -Wno-unused -Werror -emit-llvm %s -o - | FileCheck %s // RUN: %clang_cc1 -target-cpu z14 -triple s390x-linux-gnu \ -// RUN: -O -fzvector -flax-vector-conversions=none \ +// RUN: -O -fzvector -fno-lax-vector-conversions \ // RUN: -Wall -Wno-unused -Werror -S %s -o - | FileCheck %s --check-prefix=CHECK-ASM #include diff --git a/clang/test/CodeGen/builtins-systemz-zvector3-error.c b/clang/test/CodeGen/builtins-systemz-zvector3-error.c index 657508b..286cd3c 100644 --- a/clang/test/CodeGen/builtins-systemz-zvector3-error.c +++ b/clang/test/CodeGen/builtins-systemz-zvector3-error.c @@ -1,6 +1,6 @@ // REQUIRES: systemz-registered-target // RUN: %clang_cc1 -target-cpu arch13 -triple s390x-linux-gnu \ -// RUN: -fzvector -flax-vector-conversions=none \ +// RUN: -fzvector -fno-lax-vector-conversions \ // RUN: -Wall -Wno-unused -Werror -fsyntax-only -verify %s #include diff --git a/clang/test/CodeGen/builtins-systemz-zvector3.c b/clang/test/CodeGen/builtins-systemz-zvector3.c index db30f41..1367d87 100644 --- a/clang/test/CodeGen/builtins-systemz-zvector3.c +++ b/clang/test/CodeGen/builtins-systemz-zvector3.c @@ -1,9 +1,9 @@ // REQUIRES: systemz-registered-target // RUN: %clang_cc1 -target-cpu arch13 -triple s390x-linux-gnu \ -// RUN: -O -fzvector -flax-vector-conversions=none \ +// RUN: -O -fzvector -fno-lax-vector-conversions \ // RUN: -Wall -Wno-unused -Werror -emit-llvm %s -o - | FileCheck %s // RUN: %clang_cc1 -target-cpu arch13 -triple s390x-linux-gnu \ -// RUN: -O -fzvector -flax-vector-conversions=none \ +// RUN: -O -fzvector -fno-lax-vector-conversions \ // RUN: -Wall -Wno-unused -Werror -S %s -o - | FileCheck %s --check-prefix=CHECK-ASM #include diff --git a/clang/test/CodeGen/builtins-wasm.c b/clang/test/CodeGen/builtins-wasm.c index ee08983..43299bd 100644 --- a/clang/test/CodeGen/builtins-wasm.c +++ b/clang/test/CodeGen/builtins-wasm.c @@ -1,6 +1,6 @@ -// RUN: %clang_cc1 -triple wasm32-unknown-unknown -target-feature +unimplemented-simd128 -target-feature +nontrapping-fptoint -target-feature +exception-handling -target-feature +bulk-memory -flax-vector-conversions=none -O3 -emit-llvm -o - %s | FileCheck %s -check-prefixes WEBASSEMBLY,WEBASSEMBLY32 -// RUN: %clang_cc1 -triple wasm64-unknown-unknown -target-feature +unimplemented-simd128 -target-feature +nontrapping-fptoint -target-feature +exception-handling -target-feature +bulk-memory -flax-vector-conversions=none -O3 -emit-llvm -o - %s | FileCheck %s -check-prefixes WEBASSEMBLY,WEBASSEMBLY64 -// RUN: not %clang_cc1 -triple wasm64-unknown-unknown -target-feature +nontrapping-fptoint -target-feature +exception-handling -target-feature +bulk-memory -flax-vector-conversions=none -O3 -emit-llvm -o - %s 2>&1 | FileCheck %s -check-prefixes MISSING-SIMD +// RUN: %clang_cc1 -triple wasm32-unknown-unknown -target-feature +unimplemented-simd128 -target-feature +nontrapping-fptoint -target-feature +exception-handling -target-feature +bulk-memory -fno-lax-vector-conversions -O3 -emit-llvm -o - %s | FileCheck %s -check-prefixes WEBASSEMBLY,WEBASSEMBLY32 +// RUN: %clang_cc1 -triple wasm64-unknown-unknown -target-feature +unimplemented-simd128 -target-feature +nontrapping-fptoint -target-feature +exception-handling -target-feature +bulk-memory -fno-lax-vector-conversions -O3 -emit-llvm -o - %s | FileCheck %s -check-prefixes WEBASSEMBLY,WEBASSEMBLY64 +// RUN: not %clang_cc1 -triple wasm64-unknown-unknown -target-feature +nontrapping-fptoint -target-feature +exception-handling -target-feature +bulk-memory -fno-lax-vector-conversions -O3 -emit-llvm -o - %s 2>&1 | FileCheck %s -check-prefixes MISSING-SIMD // SIMD convenience types typedef char i8x16 __attribute((vector_size(16))); diff --git a/clang/test/CodeGenCXX/builtins-systemz-zvector.cpp b/clang/test/CodeGenCXX/builtins-systemz-zvector.cpp index f6ce711..aedb30f 100644 --- a/clang/test/CodeGenCXX/builtins-systemz-zvector.cpp +++ b/clang/test/CodeGenCXX/builtins-systemz-zvector.cpp @@ -1,6 +1,6 @@ // REQUIRES: systemz-registered-target // RUN: %clang_cc1 -target-cpu z13 -triple s390x-linux-gnu \ -// RUN: -fzvector -flax-vector-conversions=none -std=c++11 \ +// RUN: -fzvector -fno-lax-vector-conversions -std=c++11 \ // RUN: -Wall -Wno-unused -Werror -emit-llvm %s -o - | FileCheck %s bool gb; diff --git a/clang/test/Headers/altivec-header.c b/clang/test/Headers/altivec-header.c index 00e5f44..733ab50 100644 --- a/clang/test/Headers/altivec-header.c +++ b/clang/test/Headers/altivec-header.c @@ -1,5 +1,5 @@ // RUN: %clang_cc1 -triple powerpc64-unknown-unknown -target-feature +altivec -ffreestanding -emit-llvm -o - %s | FileCheck %s -// RUN: %clang_cc1 -triple powerpc64-unknown-unknown -target-feature +altivec -ffreestanding -emit-llvm -flax-vector-conversions=none -o - %s | FileCheck %s +// RUN: %clang_cc1 -triple powerpc64-unknown-unknown -target-feature +altivec -ffreestanding -emit-llvm -fno-lax-vector-conversions -o - %s | FileCheck %s // RUN: %clang_cc1 -triple powerpc64-unknown-unknown -target-feature +altivec -ffreestanding -emit-llvm -x c++ -o - %s | FileCheck %s #include diff --git a/clang/test/Headers/arm-neon-header.c b/clang/test/Headers/arm-neon-header.c index 1da5ed0..06b99a4 100644 --- a/clang/test/Headers/arm-neon-header.c +++ b/clang/test/Headers/arm-neon-header.c @@ -1,5 +1,5 @@ // RUN: %clang_cc1 -triple thumbv7-apple-darwin10 -target-cpu cortex-a8 -fsyntax-only -Wvector-conversions -ffreestanding %s -// RUN: %clang_cc1 -triple thumbv7-apple-darwin10 -target-cpu cortex-a8 -fsyntax-only -flax-vector-conversions=none -ffreestanding %s +// RUN: %clang_cc1 -triple thumbv7-apple-darwin10 -target-cpu cortex-a8 -fsyntax-only -fno-lax-vector-conversions -ffreestanding %s // RUN: %clang_cc1 -x c++ -triple thumbv7-apple-darwin10 -target-cpu cortex-a8 -fsyntax-only -Wvector-conversions -ffreestanding %s // RUN: %clang -fsyntax-only -ffreestanding --target=aarch64-none-eabi -march=armv8.2-a+fp16 -std=c89 -xc %s diff --git a/clang/test/Headers/x86-intrinsics-headers-clean.cpp b/clang/test/Headers/x86-intrinsics-headers-clean.cpp index dc4cd9a..0a06790 100644 --- a/clang/test/Headers/x86-intrinsics-headers-clean.cpp +++ b/clang/test/Headers/x86-intrinsics-headers-clean.cpp @@ -1,7 +1,7 @@ // Make sure the intrinsic headers compile cleanly with no warnings or errors. // RUN: %clang_cc1 -ffreestanding -triple x86_64-unknown-unknown -Wsystem-headers \ -// RUN: -fsyntax-only -flax-vector-conversions=none -x c++ -verify %s +// RUN: -fsyntax-only -fno-lax-vector-conversions -x c++ -verify %s // expected-no-diagnostics diff --git a/clang/test/Headers/x86-intrinsics-headers.c b/clang/test/Headers/x86-intrinsics-headers.c index 59ca354..91c4ffa 100644 --- a/clang/test/Headers/x86-intrinsics-headers.c +++ b/clang/test/Headers/x86-intrinsics-headers.c @@ -1,5 +1,5 @@ // RUN: %clang_cc1 -fsyntax-only -ffreestanding %s -// RUN: %clang_cc1 -fsyntax-only -ffreestanding -flax-vector-conversions=none %s +// RUN: %clang_cc1 -fsyntax-only -ffreestanding -fno-lax-vector-conversions %s // RUN: %clang_cc1 -fsyntax-only -ffreestanding -x c++ %s #if defined(i386) || defined(__x86_64__) diff --git a/clang/test/Headers/x86intrin-2.c b/clang/test/Headers/x86intrin-2.c index 404b30c..e6fd7c8 100644 --- a/clang/test/Headers/x86intrin-2.c +++ b/clang/test/Headers/x86intrin-2.c @@ -1,5 +1,5 @@ // RUN: %clang_cc1 -fsyntax-only -ffreestanding %s -verify -// RUN: %clang_cc1 -fsyntax-only -ffreestanding -flax-vector-conversions=none %s -verify +// RUN: %clang_cc1 -fsyntax-only -ffreestanding -fno-lax-vector-conversions %s -verify // RUN: %clang_cc1 -fsyntax-only -ffreestanding -x c++ %s -verify // expected-no-diagnostics diff --git a/clang/test/Headers/x86intrin.c b/clang/test/Headers/x86intrin.c index 53e3695..7c15c48 100644 --- a/clang/test/Headers/x86intrin.c +++ b/clang/test/Headers/x86intrin.c @@ -1,5 +1,5 @@ // RUN: %clang_cc1 -fsyntax-only -ffreestanding %s -verify -// RUN: %clang_cc1 -fsyntax-only -ffreestanding -flax-vector-conversions=none %s -verify +// RUN: %clang_cc1 -fsyntax-only -ffreestanding -fno-lax-vector-conversions %s -verify // RUN: %clang_cc1 -fsyntax-only -ffreestanding -x c++ %s -verify // expected-no-diagnostics diff --git a/clang/test/Sema/ext_vector_casts.c b/clang/test/Sema/ext_vector_casts.c index 5c13aca..b13f836 100644 --- a/clang/test/Sema/ext_vector_casts.c +++ b/clang/test/Sema/ext_vector_casts.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fsyntax-only -verify -flax-vector-conversions=none -Wconversion %s +// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fsyntax-only -verify -fno-lax-vector-conversions -Wconversion %s typedef __attribute__((ext_vector_type(8))) _Bool BoolVector; // expected-error {{invalid vector element type '_Bool'}} diff --git a/clang/test/Sema/typedef-retain.c b/clang/test/Sema/typedef-retain.c index 70e2abc..3d784ce 100644 --- a/clang/test/Sema/typedef-retain.c +++ b/clang/test/Sema/typedef-retain.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -fsyntax-only -verify %s -flax-vector-conversions=none +// RUN: %clang_cc1 -fsyntax-only -verify %s -fno-lax-vector-conversions typedef float float4 __attribute__((vector_size(16))); typedef int int4 __attribute__((vector_size(16))); diff --git a/clang/test/Sema/zvector.c b/clang/test/Sema/zvector.c index 798b12b..858e10d 100644 --- a/clang/test/Sema/zvector.c +++ b/clang/test/Sema/zvector.c @@ -1,5 +1,5 @@ // RUN: %clang_cc1 -triple s390x-linux-gnu -fzvector \ -// RUN: -flax-vector-conversions=none -W -Wall -Wconversion \ +// RUN: -fno-lax-vector-conversions -W -Wall -Wconversion \ // RUN: -Werror -fsyntax-only -verify %s vector signed char sc, sc2; diff --git a/clang/test/Sema/zvector2.c b/clang/test/Sema/zvector2.c index a4e0a9e..08ec9df 100644 --- a/clang/test/Sema/zvector2.c +++ b/clang/test/Sema/zvector2.c @@ -1,5 +1,5 @@ // RUN: %clang_cc1 -triple s390x-linux-gnu -fzvector -target-cpu z14 \ -// RUN: -flax-vector-conversions=none -W -Wall -Wconversion \ +// RUN: -fno-lax-vector-conversions -W -Wall -Wconversion \ // RUN: -Werror -fsyntax-only -verify %s vector signed char sc, sc2; diff --git a/clang/test/SemaCXX/altivec.cpp b/clang/test/SemaCXX/altivec.cpp index 2ba3400..92f0283 100644 --- a/clang/test/SemaCXX/altivec.cpp +++ b/clang/test/SemaCXX/altivec.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -target-feature +altivec -flax-vector-conversions=none -triple powerpc-unknown-unknown -fcxx-exceptions -verify %s +// RUN: %clang_cc1 -target-feature +altivec -fno-lax-vector-conversions -triple powerpc-unknown-unknown -fcxx-exceptions -verify %s typedef int V4i __attribute__((vector_size(16))); diff --git a/clang/test/SemaCXX/vector-no-lax.cpp b/clang/test/SemaCXX/vector-no-lax.cpp index a6e39a8..3cedcb1 100644 --- a/clang/test/SemaCXX/vector-no-lax.cpp +++ b/clang/test/SemaCXX/vector-no-lax.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -flax-vector-conversions=none -verify %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -fno-lax-vector-conversions -verify %s typedef unsigned int __attribute__((vector_size (16))) vUInt32; typedef int __attribute__((vector_size (16))) vSInt32; diff --git a/clang/test/SemaCXX/vector.cpp b/clang/test/SemaCXX/vector.cpp index 67e5a94..295e1e1 100644 --- a/clang/test/SemaCXX/vector.cpp +++ b/clang/test/SemaCXX/vector.cpp @@ -1,8 +1,6 @@ -// RUN: %clang_cc1 -flax-vector-conversions=all -triple x86_64-apple-darwin10 -fsyntax-only -verify %s -// RUN: %clang_cc1 -flax-vector-conversions=all -triple x86_64-apple-darwin10 -fsyntax-only -verify -std=c++98 %s -// RUN: %clang_cc1 -flax-vector-conversions=all -triple x86_64-apple-darwin10 -fsyntax-only -verify -std=c++11 %s -// RUN: %clang_cc1 -flax-vector-conversions=integer -triple x86_64-apple-darwin10 -fsyntax-only -verify %s -DNO_LAX_FLOAT -// RUN: %clang_cc1 -flax-vector-conversions=none -triple x86_64-apple-darwin10 -fsyntax-only -verify %s -DNO_LAX_FLOAT -DNO_LAX_INT +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -verify %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -verify -std=c++98 %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -verify -std=c++11 %s typedef char char16 __attribute__ ((__vector_size__ (16))); typedef long long longlong16 __attribute__ ((__vector_size__ (16))); @@ -10,19 +8,13 @@ typedef char char16_e __attribute__ ((__ext_vector_type__ (16))); typedef long long longlong16_e __attribute__ ((__ext_vector_type__ (2))); // Test overloading and function calls with vector types. -void f0(char16); // expected-note 0+{{candidate}} +void f0(char16); void f0_test(char16 c16, longlong16 ll16, char16_e c16e, longlong16_e ll16e) { f0(c16); f0(ll16); -#ifdef NO_LAX_INT - // expected-error@-2 {{no matching function}} -#endif f0(c16e); f0(ll16e); -#ifdef NO_LAX_INT - // expected-error@-2 {{no matching function}} -#endif } int &f1(char16); @@ -35,14 +27,12 @@ void f1_test(char16 c16, longlong16 ll16, char16_e c16e, longlong16_e ll16e) { float &fr2 = f1(ll16e); } -void f2(char16_e); // expected-note 0+{{candidate}} +void f2(char16_e); // expected-note{{no known conversion from 'longlong16_e' (vector of 2 'long long' values) to 'char16_e' (vector of 16 'char' values) for 1st argument}} \ + // expected-note{{candidate function not viable: no known conversion from 'convertible_to' to 'char16_e' (vector of 16 'char' values) for 1st argument}} void f2_test(char16 c16, longlong16 ll16, char16_e c16e, longlong16_e ll16e) { f2(c16); f2(ll16); -#ifdef NO_LAX_INT - // expected-error@-2 {{no matching function}} -#endif f2(c16e); f2(ll16e); // expected-error{{no matching function}} f2('a'); @@ -68,11 +58,6 @@ void conditional(bool Cond, char16 c16, longlong16 ll16, char16_e c16e, (void)(Cond? c16 : ll16); (void)(Cond? ll16e : c16e); (void)(Cond? ll16e : c16); -#ifdef NO_LAX_INT - // expected-error@-4 {{cannot convert}} - // expected-error@-4 {{cannot convert}} - // expected-error@-4 {{cannot convert}} -#endif } // Test C++ cast'ing of vector types. @@ -100,16 +85,9 @@ void casts(longlong16 ll16, longlong16_e ll16e) { // static_cast (void)static_cast(ll16); (void)static_cast(ll16); -#ifdef NO_LAX_INT - // expected-error@-3 {{not allowed}} - // expected-error@-3 {{not allowed}} -#endif (void)static_cast(ll16); (void)static_cast(ll16); (void)static_cast(ll16e); -#ifdef NO_LAX_INT - // expected-error@-2 {{not allowed}} -#endif (void)static_cast(ll16e); // expected-error{{static_cast from 'longlong16_e' (vector of 2 'long long' values) to 'char16_e' (vector of 16 'char' values) is not allowed}} (void)static_cast(ll16e); (void)static_cast(ll16e); @@ -143,19 +121,10 @@ void test_implicit_conversions(bool Cond, char16 c16, longlong16 ll16, convertible_to rto_c16e) { f0(to_c16); f0(to_ll16); -#ifdef NO_LAX_INT - // expected-error@-2 {{no matching function}} -#endif f0(to_c16e); f0(to_ll16e); -#ifdef NO_LAX_INT - // expected-error@-2 {{no matching function}} -#endif f2(to_c16); f2(to_ll16); -#ifdef NO_LAX_INT - // expected-error@-2 {{no matching function}} -#endif f2(to_c16e); f2(to_ll16e); // expected-error{{no matching function}} @@ -224,10 +193,6 @@ void test_implicit_conversions(bool Cond, char16 c16, longlong16 ll16, // These 2 are convertible with -flax-vector-conversions (default) (void)(Cond? to_c16 : to_ll16); (void)(Cond? to_c16e : to_ll16e); -#ifdef NO_LAX_INT - // expected-error@-3 {{cannot convert}} - // expected-error@-3 {{cannot convert}} -#endif } typedef float fltx2 __attribute__((__vector_size__(8))); @@ -238,10 +203,6 @@ typedef double dblx4 __attribute__((__vector_size__(32))); void accept_fltx2(fltx2); // expected-note{{candidate function not viable: no known conversion from 'double' to 'fltx2' (vector of 2 'float' values) for 1st argument}} void accept_fltx4(fltx4); void accept_dblx2(dblx2); -#ifdef NO_LAX_FLOAT -// expected-note@-3 {{no known conversion}} -// expected-note@-3 {{no known conversion}} -#endif void accept_dblx4(dblx4); void accept_bool(bool); // expected-note{{candidate function not viable: no known conversion from 'fltx2' (vector of 2 'float' values) to 'bool' for 1st argument}} @@ -253,12 +214,9 @@ void test(fltx2 fltx2_val, fltx4 fltx4_val, dblx2 dblx2_val, dblx4 dblx4_val) { accept_dblx4(dblx4_val); // Same-size conversions + // FIXME: G++ rejects these conversions, we accept them. Revisit this! accept_fltx4(dblx2_val); accept_dblx2(fltx4_val); -#ifdef NO_LAX_FLOAT - // expected-error@-3 {{no matching function}} - // expected-error@-3 {{no matching function}} -#endif // Conversion to bool. accept_bool(fltx2_val); // expected-error{{no matching function for call to 'accept_bool'}} @@ -269,9 +227,9 @@ void test(fltx2 fltx2_val, fltx4 fltx4_val, dblx2 dblx2_val, dblx4 dblx4_val) { typedef int intx4 __attribute__((__vector_size__(16))); typedef int inte4 __attribute__((__ext_vector_type__(4))); -typedef float flte4 __attribute__((__ext_vector_type__(4))); +typedef int flte4 __attribute__((__ext_vector_type__(4))); -void test_mixed_vector_types(fltx4 f, intx4 n, flte4 g, inte4 m) { +void test_mixed_vector_types(fltx4 f, intx4 n, flte4 g, flte4 m) { (void)(f == g); (void)(g != f); (void)(f <= g); @@ -337,40 +295,40 @@ typedef bool bad __attribute__((__vector_size__(16))); // expected-error {{inva namespace Templates { template struct TemplateVectorType { - typedef Elt __attribute__((__vector_size__(Size))) type; // #1 + typedef Elt __attribute__((__vector_size__(Size))) type; }; template struct PR15730 { typedef T __attribute__((vector_size(N * sizeof(T)))) type; - typedef T __attribute__((vector_size(8192))) type2; // #2 - typedef T __attribute__((vector_size(3))) type3; // #3 + typedef T __attribute__((vector_size(8192))) type2; + typedef T __attribute__((vector_size(3))) type3; }; void Init() { const TemplateVectorType::type Works = {}; const TemplateVectorType::type Works2 = {}; - // expected-error@#1 {{invalid vector element type 'bool'}} + // expected-error@298 {{invalid vector element type 'bool'}} // expected-note@+1 {{in instantiation of template class 'Templates::TemplateVectorType' requested here}} const TemplateVectorType::type NoBool; - // expected-error@#1 {{invalid vector element type 'int __attribute__((ext_vector_type(4)))' (vector of 4 'int' values)}} + // expected-error@298 {{invalid vector element type 'int __attribute__((ext_vector_type(4)))' (vector of 4 'int' values)}} // expected-note@+1 {{in instantiation of template class 'Templates::TemplateVectorType' requested here}} const TemplateVectorType::type NoComplex; - // expected-error@#1 {{vector size not an integral multiple of component size}} + // expected-error@298 {{vector size not an integral multiple of component size}} // expected-note@+1 {{in instantiation of template class 'Templates::TemplateVectorType' requested here}} const TemplateVectorType::type BadSize; - // expected-error@#1 {{vector size too large}} + // expected-error@298 {{vector size too large}} // expected-note@+1 {{in instantiation of template class 'Templates::TemplateVectorType' requested here}} const TemplateVectorType::type TooLarge; - // expected-error@#1 {{zero vector size}} + // expected-error@298 {{zero vector size}} // expected-note@+1 {{in instantiation of template class 'Templates::TemplateVectorType' requested here}} const TemplateVectorType::type Zero; - // expected-error@#2 {{vector size too large}} - // expected-error@#3 {{vector size not an integral multiple of component size}} + // expected-error@304 {{vector size too large}} + // expected-error@305 {{vector size not an integral multiple of component size}} // expected-note@+1 {{in instantiation of template class 'Templates::PR15730<8, int>' requested here}} const PR15730<8, int>::type PR15730_1 = {}; - // expected-error@#2 {{vector size too large}} + // expected-error@304 {{vector size too large}} // expected-note@+1 {{in instantiation of template class 'Templates::PR15730<8, char>' requested here}} const PR15730<8, char>::type2 PR15730_2 = {}; } -- 2.7.4