Commit Graph

27 Commits

Author SHA1 Message Date
jyn
f1e5b365f0 port tests/ui/linkage-attr/framework to run-make
this makes it much easier to understand test failures.

before:
```
diff of stderr:

1 error: linking with `LINKER` failed: exit status: 1
2    |
-            ld: Undefined symbols:
4              _CFRunLoopGetTypeID, referenced from:
5            clang: error: linker command failed with exit code 1 (use -v to see invocation)
```

after:
```
=== HAYSTACK ===
error: linking with `cc` failed: exit status: 1
  |
  = note: use `--verbose` to show all linker arguments
  = note: Undefined symbols for architecture arm64:
            "_CFRunLoopGetTypeID", referenced from:
                main::main::hbb553f5dda62d3ea in main.main.d17f5fbe6225cf88-cgu.0.rcgu.o
          ld: symbol(s) not found for architecture arm64
          clang: error: linker command failed with exit code 1 (use -v to see invocation)

error: aborting due to 1 previous error

=== NEEDLE ===
_CFRunLoopGetTypeID\.?, referenced from:
thread 'main' panicked at /Users/jyn/git/rust-lang/rust/tests/run-make/linkage-attr-framework/rmake.rs:22:10:
needle was not found in haystack
```

this also fixes a failure related to missing whitespace; we don't actually care about whitespace in this test.
2024-10-27 21:23:28 -04:00
Obei Sideg
3b0ce1bc33
Update tests for hidden references to mutable static 2024-09-13 14:10:56 +03:00
Ralf Jung
cf6f6ca441 unreferenced-used-static: run test everywhere 2024-06-29 13:02:59 +02:00
Rémy Rakic
57931e5040 add non-regression test for issue 127052 2024-06-28 20:59:33 +00:00
bjorn3
07dc3ebf5c Allow static mut definitions with #[linkage]
Unlike static declarations with #[linkage], for definitions rustc
doesn't rewrite it to add an extra indirection.
2024-06-03 10:45:16 +00:00
Mads Marquart
e6b9bb7b72 Make more of the test suite run on Mac Catalyst
This adds the `only-apple`/`ignore-apple` compiletest directive, and
uses that basically everywhere instead of `only-macos`/`ignore-macos`.

Some of the updates in `run-make` are a bit redundant, as they use
`ignore-cross-compile` and won't run on iOS - but using Apple in these
is still more correct, so I've made that change anyhow.
2024-05-28 12:31:33 +02:00
bjorn3
531dae1cdf Only allow immutable statics with #[linkage] 2024-05-13 14:34:32 +00:00
Mads Marquart
ff3f0a3467 Add test for linking to UIKit 2024-04-10 17:43:45 +02:00
Caio
ab8994d93e Move tests 2024-04-07 17:38:07 -03:00
Mads Marquart
de212963f8 Relax framework linking test
This test was introduced in #118644, but was over-specified in that it assumed the path of the linker was always `cc`.
2024-04-06 09:00:07 +02:00
Mads Marquart
ec5c8fec6c Add test for Apple's -weak_framework linker argument 2024-03-18 23:27:34 +01:00
Alex Crichton
cf6d6050f7 Update test directives for wasm32-wasip1
* The WASI targets deal with the `main` symbol a bit differently than
  native so some `codegen` and `assembly` tests have been ignored.
* All `ignore-emscripten` directives have been updated to
  `ignore-wasm32` to be more clear that all wasm targets are ignored and
  it's not just Emscripten.
* Most `ignore-wasm32-bare` directives are now gone.
* Some ignore directives for wasm were switched to `needs-unwind`
  instead.
* Many `ignore-wasm32*` directives are removed as the tests work with
  WASI as opposed to `wasm32-unknown-unknown`.
2024-03-11 09:36:35 -07:00
Jubilee Young
f7b621cfab Clarify FatalErrorHandler
Clarify the FatalErrorHandler API that we use:
- Identify rustc's LLVM ERRORs by prefixing them
- Comment heavily on its interior, while we are here
2024-03-05 20:52:54 -08:00
许杰友 Jieyou Xu (Joe)
ec2cc761bc
[AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
George-lewis
d56cdd48cb Bless tests
Update tests
2024-01-13 12:46:58 -05:00
Nilstrieb
41e8d152dc Show number in error message even for one error
Co-authored-by: Adrian <adrian.iosdev@gmail.com>
2023-11-24 19:15:52 +01:00
Rémy Rakic
d634cc5a55 add test for -Clink-self-contained consistency 2023-10-08 21:57:39 +00:00
Vadim Petrochenkov
7ecb09d05c linker: Remove unstable legacy CLI linker flavors 2023-10-07 21:57:53 +03:00
David Mo
4160337c85 Tests crash from inappropriate use of common linkage
Normally, variables with common linkage must be zero-initialized. In Rust,
common linkage variables that are not zero-initialized causes a crash in the
compiler backend.

This commit adds a test case to confirm this behavior, which will inform us if
it changes in the future.
2023-09-01 14:08:31 -07:00
Ben Kimock
4e21e9e039 Remove some unnecessary normalization 2023-07-05 19:52:28 -04:00
Rémy Rakic
38f5a9964b comment, and bless, unstable linker flavor test 2023-06-30 21:13:24 +00:00
Rémy Rakic
4ff780be2f bless test with new linker flavors 2023-06-30 21:13:24 +00:00
Vadim Petrochenkov
2f7328d970 Fix tests on non-unix targets 2023-05-29 19:58:11 +03:00
Vadim Petrochenkov
23f177d86d rustc_session: Feature gate linker flavors for tier 3 targets 2023-05-29 19:58:11 +03:00
Vadim Petrochenkov
b0ce4164f0 linker: Report linker flavors incompatible with the current target
Previously they would be reported as link time errors about unknown linker options
2023-05-29 19:58:11 +03:00
yukang
d5558e67ef The name of NativeLib will be presented 2023-03-19 11:23:19 +08:00
Albert Larsan
cf2dff2b1e
Move /src/test to /tests 2023-01-11 09:32:08 +00:00