about summary refs log tree commit diff
path: root/src/test/codegen
AgeCommit message (Collapse)AuthorLines
2019-10-31rustc_codegen_ssa: move all set_var_name calls to mir::debuginfo.Eduard-Mihai Burtescu-86/+99
2019-10-29Rollup merge of #65832 - tlively:emscripten-exception-handling, r=alexcrichtonTyler Mandry-5/+5
Re-enable Emscripten's exception handling support Passes LLVM codegen and Emscripten link-time flags for exception handling if and only if the panic strategy is `unwind`. Sets the default panic strategy for Emscripten targets to `unwind`. Re-enables tests that depend on unwinding support for Emscripten, including `should_panic` tests. r? @alexcrichton
2019-10-26Only run efiapi test on llvm 9.0+roblabla-0/+2
2019-10-25Re-enable Emscripten's exception handling supportThomas Lively-5/+5
Passes LLVM codegen and Emscripten link-time flags for exception handling if and only if the panic strategy is `unwind`. Sets the default panic strategy for Emscripten targets to `unwind`. Re-enables tests that depend on unwinding support for Emscripten, including `should_panic` tests.
2019-10-25Fix EFIABI testroblabla-12/+21
Use revisions to run the EFIABI in multiple configurations, compiling for each supported UEFI platform, and checking the ABI generated in the LLVM IR is correct. Use no_core to make it easier to test.
2019-10-25Add new EFIAPI ABIroblabla-0/+20
Adds a new ABI for the EFIAPI calls. This ABI should reflect the latest version of the UEFI specification at the time of commit (UEFI spec 2.8, URL below). The specification says that for x86_64, we should follow the win64 ABI, while on all other supported platforms (ia32, itanium, arm, arm64 and risc-v), we should follow the C ABI. To simplify the implementation, we will simply follow the C ABI on all platforms except x86_64, even those technically unsupported by the UEFI specification. https://uefi.org/sites/default/files/resources/UEFI_Spec_2_8_final.pdf
2019-10-16Upgrade Emscripten targets to use upstream LLVM backendThomas Lively-118/+92
- Compatible with Emscripten 1.38.46-upstream or later upstream. - Refactors the Emscripten target spec to share code with other wasm targets. - Replaces the old incorrect wasm32 C call ABI with the correct one, preserving the old one as wasm32_bindgen_compat for wasm-bindgen compatibility. - Updates the varargs ABI used by Emscripten and deletes the old one. - Removes the obsolete wasm32-experimental-emscripten target. - Uses EMCC_CFLAGS on CI to avoid the timeout problems with #63649.
2019-10-12make tests more robustRalf Jung-2/+2
2019-10-12some typographyRalf Jung-2/+2
2019-10-12also (properly) test nounwind on function definitionsRalf Jung-6/+19
2019-10-12update test for nounwind on FFI importsRalf Jung-19/+41
2019-09-28Gate llvm.sideeffect under -Z insert-sideeffectXiang Fan-35/+19
2019-09-28Add llvm.sideeffect to potential infinite loops and recursionsXiang Fan-16/+82
LLVM assumes that a thread will eventually cause side effect. This is not true in Rust if a loop or recursion does nothing in its body, causing undefined behavior even in common cases like `loop {}`. Inserting llvm.sideeffect fixes the undefined behavior. As a micro-optimization, only insert llvm.sideeffect when jumping back in blocks or calling a function. A patch for LLVM is expected to allow empty non-terminate code by default and fix this issue from LLVM side. https://github.com/rust-lang/rust/issues/28728
2019-09-13codegen: use "_N" (like for other locals) instead of "argN", for argument names.Eduard-Mihai Burtescu-54/+54
2019-09-12codegen: be more explicit about setting giving names to allocas.Eduard-Mihai Burtescu-4/+5
2019-09-09test/c-variadic: Fix patterns on powerpc64Samuel Holland-11/+12
On architectures such as powerpc64 that use extend_integer_width_to in their C ABI processing, integer parameters shorter than the native register width will be annotated with the ArgAttribute::SExt or ArgAttribute::ZExt attribute, and that attribute will be included in the generated LLVM IR. In this test, all relevant parameters are `i32`, which will get the `signext` annotation on the relevant 64-bit architectures. Match both the annotated and non-annotated case, but enforce that the annotation is applied consistently.
2019-09-06rustc_codegen_llvm: give names to non-alloca variable values.Eduard-Mihai Burtescu-0/+15
2019-08-29Small improvement for Ord implementation of integersLzu Tao-2/+2
2019-08-26add link to FileCheck docsRalf Jung-0/+2
2019-08-25Force #[unwind(aborts)] in test/codegen/c-variadic.rsJosh Stone-0/+6
2019-08-21Add codegen test for integers compareLzu Tao-0/+28
2019-08-19Cherry-pick src/test changes with Centril's changessd234678-3/+0
2019-08-12Add codegen tests for the genericity of fold closuresJosh Stone-0/+24
2019-07-16Auto merge of #62592 - nikic:actually-update-llvm, r=alexcrichtonbors-12/+14
Update to LLVM 9 trunk Following the preparatory changes in #62474, this updates the LLVM submodule to https://github.com/rust-lang/llvm-project/tree/rustc/9.0-2019-07-12 and: * Changes the LLVM Rust bindings to account for the new SubtargetSubTypeKV. * Adjusts a codegen test for the new form of the byval attribute that takes a type. * Makes a PGO codegen test more liberal with regard to order and linkage. * Builds InstrProfilingPlatformWindows.c as part of libprofiler_builtins. * Moves registration of additional passes (in particular sanitizers) to the end of the module pass manager. * Disables LLDB on builders. r? @alexcrichton
2019-07-15ignore some codegen tests in debug modeRalf Jung-0/+3
2019-07-15Relax checks in pgo-instrumentation codegen testNikita Popov-4/+4
Don't require a specific order for the per-function globals, and don't require the locals to have private linkage (apparently internal linkage is also possible).
2019-07-15Update transparent aggregate codegen test for byval changesNikita Popov-8/+10
2019-07-09Adjust codegen tests for DISPFlagMainSubprogramNikita Popov-2/+2
2019-06-21Stabilize profile-guided optimization.Michael Woerister-2/+2
2019-06-18Auto merge of #59625 - immunant:copy_variadics_typealias, r=eddybbors-3/+30
Refactor C FFI variadics to more closely match their C counterparts, and add Clone implementation We had to make some changes to expose `va_copy` and `va_end` directly to users (mainly for C2Rust, but not exclusively): - redefine the Rust variadic structures to more closely correspond to C: `VaList` now matches `va_list`, and `VaListImpl` matches `__va_list_tag` - add `Clone` for `VaListImpl` - add explicit `as_va_list()` conversion function from `VaListImpl` to `VaList` - add deref coercion from `VaList` to `VaListImpl` - add support for the `asmjs` target All these changes were needed for use cases like: ```Rust let mut ap2 = va_copy(ap); vprintf(fmt, ap2); va_end(&mut ap2); ```
2019-06-17Expose `VaListImpl` as the Rust equivalent of `__va_list_tag` and implement ↵Andrei Homescu-3/+30
Clone for it.
2019-06-17Rollup merge of #61885 - scottmcm:slice-iter-len-opt, r=rkruppe,RalfJungMazdak Farrokhzad-0/+14
Help LLVM better optimize slice::Iter(Mut)::len r? @RalfJung I've included a codegen test that fails without this change as a demonstration of usefulness.
2019-06-15Help LLVM better optimize slice::Iter(Mut)::lenScott McMurray-0/+14
2019-06-13Create fewer basic blocks in match MIR loweringMatthew Jasper-2/+2
2019-06-11Rollup merge of #61526 - lcnr:test_reorder, r=nikomatsakisMazdak Farrokhzad-2/+2
move some tests into subfolders This reduces the size of the test folders without making the moved tests harder to find. Is this kind of change desired/worth the effort?
2019-06-10Implement RFC 2645 (transparent enums and unions)Michael Bradshaw-28/+190
Tracking issue: #60405
2019-06-09Auto merge of #61229 - Centril:stabilize-repr_align_enum, r=nagisabors-1/+0
Stabilize #![feature(repr_align_enum)] in Rust 1.37.0 On an `enum` item, you may now write: ```rust #[repr(align(X))] enum Foo { // ... } ``` This has equivalent effects to first defining: ```rust #[repr(align(X))] struct AlignX<T>(T); ``` and then using `AlignX<Foo>` in `Foo`'s stead. r? @nagisa
2019-06-08Turn `#[allocator]` into a built-in attribute and rename it to ↵Vadim Petrochenkov-2/+2
`#[rustc_allocator]`
2019-06-04improve test indentationlcnr/Bastian Kauschke-2/+2
2019-06-04move intrinsics codegen tests into a seperate folderlcnr/Bastian Kauschke-0/+0
2019-06-03add codegen test for unchecked mathlcnr/Bastian Kauschke-0/+46
2019-05-31test: support both (`legacy` and `v0`) choices of mangling.Eduard-Mihai Burtescu-17/+38
2019-05-28Make test/codegen/pgo-instrumentation.rs work reliably on Windows.Michael Woerister-4/+7
2019-05-27Stabilize repr_align_enum in 1.37.0.Mazdak Farrokhzad-1/+0
2019-05-20stabilize core parts of MaybeUninit and deprecate mem::uninitialized in the ↵Ralf Jung-1/+0
future Also expand the documentation a bit
2019-05-18Auto merge of #60386 - Goirad:sgx-ignore-tests, r=nikomatsakisbors-0/+2
Added ignore-sgx for appropriate tests in src/test These are all the tests that make sense to ignore when targeting fortanix-unknonw-sgx, at least in test/runpass. Other suites not yet covered.
2019-05-17Auto merge of #60171 - matthewjasper:full-nll-compare-mode, r=pnkfelixbors-1/+0
Use -Zborrowck=mir for NLL compare mode closes #56993 r? @pnkfelix
2019-05-16Added ignore-sgx for appropriate testsDario Gonzalez-0/+2
2019-05-15Auto merge of #60775 - hellow554:no_bitrig, r=joshtriplettbors-2/+0
Remove bitrig support from rust Resolves #60743 using `find` and `rg` I delete every occurence of "bitrig" in the sources, expect for the llvm submodule (is this correct?). There's also this file https://github.com/rust-lang/rls/blob/5b8e99bb61958ca8abcb7c5eda70521726be1065/rls-analysis/test_data/rust-analysis/libstd-af9bacceee784405.json which contains a bitrig string in it. What to do with that?
2019-05-13default to $ARCH-apple-macosx10.7.0 LLVM triple for darwin targetsNathan Froyd-2/+2
Over in #60378, we made `rustc` switch LLVM target triples dynamically based on the `MACOSX_DEPLOYMENT_TARGET` environment variable. This change was made to align with `clang`'s behavior, and therefore make cross-language LTO feasible on OS X. Otherwise, `rustc` would produce LLVM bitcode files with a target triple of `x86_64-apple-darwin`, `clang` would produce LLVM bitcode files with a target triple of `x86_64-apple-macosx$VERSION`, and the linker would complain. This change worked fine, except for one corner case: if you didn't have `MACOSX_DEPLOYMENT_TARGET` set, and you wanted to do LTO on just Rust code, you'd get warning messages similar to: ``` warning: Linking two modules of different target triples: ' is 'x86_64-apple-macosx10.7.0' whereas 'main.7rcbfp3g-cgu.4' is 'x86_64-apple-darwin' ``` This message occurs because libstd is compiled with `MACOSX_DEPLOYMENT_TARGET` set to 10.7. The LLVM bitcode distributed in libstd's rlibs, then, is tagged with the target triple of `x86_64-apple-macosx10.7.0`, while the bitcode `rustc` produces for "user" code is tagged with the target triple of `x86_64-apple-darwin`. It's not good to have LTO on just Rust code (probably much more common than cross-language LTO) warn by default. These warnings also break Cargo's testsuite. This change defaults to acting as though `MACOSX_DEPLOYMENT_TARGET` was set to 10.7. "user" code will then be given a target triple that is equivalent to the target triple libstd bitcode is already using. The above warning will therefore go away. `rustc` already assumes that compiling without `MACOSX_DEPLOYMENT_TARGET` means that we're compiling for a target compatible with OS X 10.7 (e.g. that things like TLS work properly). So this change is really just making things conform more closely to the status quo. (It's also worth noting that before and after this patch, compiling with `MACOSX_DEPLOYMENT_TARGET` set to, say, 10.9, works just fine: target triples with an "apple" version ignore OS versions when checking compatibility, so bitcode with a `x86_64-apple-macosx10.7.0` triple works just fine with bitcode with a `x86_64-apple-macosx10.9.0` triple.)