rust/src/test/codegen
kennytm 8b8c6ee796
Rollup merge of #47912 - cuviper:glibc-stack-guard, r=alexcrichton
Use a range to identify SIGSEGV in stack guards

Previously, the `guard::init()` and `guard::current()` functions were
returning a `usize` address representing the top of the stack guard,
respectively for the main thread and for spawned threads.  The `SIGSEGV`
handler on `unix` targets checked if a fault was within one page below that
address, if so reporting it as a stack overflow.

Now `unix` targets report a `Range<usize>` representing the guard memory,
so it can cover arbitrary guard sizes.  Non-`unix` targets which always
return `None` for guards now do so with `Option<!>`, so they don't pay any
overhead.

For `linux-gnu` in particular, the previous guard upper-bound was
`stackaddr + guardsize`, as the protected memory was *inside* the stack.
This was a glibc bug, and starting from 2.27 they are moving the guard
*past* the end of the stack.  However, there's no simple way for us to know
where the guard page actually lies, so now we declare it as the whole range
of `stackaddr ± guardsize`, and any fault therein will be called a stack
overflow.  This fixes #47863.
2018-02-04 23:28:57 +08:00
..
auxiliary rustc: Add LLVM nounwind with -C panic=abort 2017-10-11 09:05:38 -07:00
dllimports Add 'ignore-cloudabi' to tests that don't and won't build on CloudABI. 2018-01-02 14:11:41 +01:00
remap_path_prefix Use PathBuf instead of String where applicable 2017-12-14 11:22:08 +01:00
abi-main-signature-16bit-c-int.rs rustc: Use 16bit c_int for msp430 2017-09-30 16:30:12 +02:00
abi-main-signature-32bit-c-int.rs rustc: Use 16bit c_int for msp430 2017-09-30 16:30:12 +02:00
abi-sysv64.rs Stabilize abi_sysv64 2017-12-06 01:19:35 +01:00
abi-x86-interrupt.rs Remove two obsolete min-llvm-version tests 2017-10-18 07:54:35 -07:00
adjustments.rs rustc: encode scalar pairs in layout ABI. 2017-11-19 02:43:32 +02:00
align-struct.rs Stabilized #[repr(align(x))] attribute (RFC 1358) 2018-01-23 08:36:13 +11:00
alloc-optimisation.rs Add a no-system-llvm compilecheck header 2017-06-15 19:11:55 +03:00
coercions.rs Disable old trans access via -Z orbit, #[rustc_no_mir] or --disable-orbit. 2016-08-24 13:23:37 +03:00
consts.rs rustc: do not inject discriminant fields into Layout::General's variants. 2017-11-19 02:14:28 +02:00
dealloc-no-unwind.rs std: Mark allocation functions as nounwind 2017-08-28 08:06:52 -07:00
drop.rs Update test/codegen/drop.rs to reflect inconsequential change in basic block ordering. 2017-06-12 13:06:42 +02:00
enum-bounds-check.rs emit an assume that cast-from enums are in range 2016-10-05 14:12:30 +03:00
extern-functions.rs tests: Force instantiation of extern fns. 2016-03-17 21:51:50 +02:00
fastcall-inreg.rs Update fastcall-inreg codegen test so that functions actually get instantiated. 2017-11-08 11:09:48 +01:00
fatptr.rs Avoid FCA loads and extractvalue when copying fat pointers 2015-11-20 21:42:13 +01:00
float_math.rs Fix typo in codegen test 2017-10-07 18:04:23 +02:00
foo.s Add global_asm tests 2017-04-12 19:12:50 -05:00
function-arguments.rs rustc_trans: keep LLVM types for trait objects anonymous. 2018-01-31 00:23:25 +02:00
gdb_debug_script_load.rs Avoid loading the whole gdb debug scripts section. 2015-09-21 15:43:52 -05:00
global_asm.rs Add global_asm tests 2017-04-12 19:12:50 -05:00
global_asm_include.rs Add global_asm tests 2017-04-12 19:12:50 -05:00
global_asm_x2.rs Add global_asm tests 2017-04-12 19:12:50 -05:00
internalize-closures.rs Add codegen test to make sure that closures are 'internalized' properly. 2016-07-19 06:22:35 -04:00
intrinsic-no-unnamed-attr.rs Don't add unnamed address attributes to intrinsics. 2015-09-06 19:26:41 -05:00
issue-15953.rs Add tests for issues with the 'E-needtest' label. 2017-03-07 14:01:19 +09:00
issue-32031.rs rustc: unpack scalar newtype layout ABIs. 2017-11-19 02:43:55 +02:00
issue-32364.rs adapt tests 2016-10-25 19:56:36 +02:00
issue-34947-pow-i32.rs add test for not optimized pow with constant power 2017-09-02 19:10:00 +03:00
issue-37945.rs Fix some tests for linux gnux32 2017-10-20 13:18:16 -02:00
issue-45466.rs Simplify CFG after IndVarSimplify 2017-12-14 22:35:37 -06:00
issue-47278.rs Compute LLVM argument indices correctly in face of padding 2018-01-16 12:49:38 +01:00
issue-47442.rs remove noop landing pads in cleanup shims 2018-01-16 00:07:06 +02:00
lifetime_start_end.rs Relax a codegen test to be compatible with LLVM 5.0 2017-07-21 14:15:09 -07:00
likely.rs core: add likely and unlikely intrinsics 2016-09-02 10:29:32 -07:00
link-dead-code.rs Generate code for const- and inline-fns if -Clink-dead-code is specified. 2018-01-04 10:12:20 +01:00
link_section.rs rustc_trans: use a predictable layout for constant ADTs. 2017-11-19 02:14:28 +02:00
loads.rs Disable old trans access via -Z orbit, #[rustc_no_mir] or --disable-orbit. 2016-08-24 13:23:37 +03:00
lto-removes-invokes.rs rustc: Implement custom panic runtimes 2016-05-09 08:22:36 -07:00
mainsubprogram.rs Update the codegen/mainsubprogram tests to min-llvm 4.0 2017-10-16 13:10:16 -07:00
mainsubprogramstart.rs Update the codegen/mainsubprogram tests to min-llvm 4.0 2017-10-16 13:10:16 -07:00
match-optimizes-away.rs Don't glob-import overlapping variant names in test/codegen/match-optimizes-away.rs. 2017-11-19 09:12:10 +02:00
match.rs always add an unreachable branch on matches to give more info to llvm about which values are possible 2017-11-14 06:33:39 +00:00
mir_zst_stores.rs Update codegen tests. 2017-11-07 08:54:38 +01:00
move-val-init.rs Avoid unnecessary copies of arguments that are simple bindings 2017-10-26 12:54:34 +02:00
naked-functions.rs Update codegen tests. 2017-11-07 08:54:38 +01:00
nontemporal.rs rustc: Add support for some more x86 SIMD ops 2017-11-25 11:03:13 -08:00
noreturnflag.rs Ensure test doesn't run with llvm 3.9 2018-01-21 12:36:25 -06:00
nounwind.rs rustc: Add LLVM nounwind with -C panic=abort 2017-10-11 09:05:38 -07:00
packed.rs rustc: don't unpack newtypes of scalar-pairs with mismatched alignment. 2017-12-02 00:29:56 +02:00
panic-abort-windows.rs Add 'ignore-cloudabi' to tests that don't and won't build on CloudABI. 2018-01-02 14:11:41 +01:00
personality_lifetimes.rs remove cleanup branches to the resume block 2017-04-22 21:00:50 +03:00
prefetch.rs Remove excessive trailing newlines. 2017-12-30 15:50:52 +08:00
refs.rs rustc: unpack scalar pair newtype layout ABIs. 2017-11-19 02:43:55 +02:00
repr-transparent-aggregates-1.rs Implement repr(transparent) 2018-01-16 08:58:32 +01:00
repr-transparent-aggregates-2.rs Implement repr(transparent) 2018-01-16 08:58:32 +01:00
repr-transparent.rs Implement repr(transparent) 2018-01-16 08:58:32 +01:00
slice-init.rs rustc_trans: use more of the trans::mir and ty::layout APIs throughout. 2017-11-19 02:14:28 +02:00
stack-probes.rs Enable stack-probe tests with system LLVM >= 5.0 2018-01-31 11:41:26 -08:00
stores.rs Avoid unnecessary copies of arguments that are simple bindings 2017-10-26 12:54:34 +02:00
unchecked-float-casts.rs Make saturating u128 -> f32 casts the default behavior 2017-11-10 10:12:30 +01:00
vec-optimizes-away.rs std: Mark Layout::repeat as #[inline] 2017-07-29 09:03:06 -07:00
vtabletype.rs Emit debug info for trait object pointer 2017-11-15 01:48:14 -07:00
x86_mmx.rs rustc: SIMD types use pointers in Rust's ABI 2018-01-25 12:05:24 -08:00
zip.rs Expand .zip() specialization to .map() and .cloned() 2016-10-17 10:58:21 +02:00