mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 13:54:21 +00:00
use deterministic order in relocatable-eh-frame tests
This test does not pass in master branch either if you flip the object order around.
This commit is contained in:
parent
3deb9ab30a
commit
f2efe05155
2 changed files with 33 additions and 10 deletions
|
|
@ -6059,7 +6059,7 @@ test "classifyFileExt" {
|
||||||
try std.testing.expectEqual(FileExt.zig, classifyFileExt("foo.zig"));
|
try std.testing.expectEqual(FileExt.zig, classifyFileExt("foo.zig"));
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_libc_crt_file(comp: *Compilation, arena: Allocator, basename: []const u8) !Path {
|
fn get_libc_crt_file(comp: *Compilation, arena: Allocator, basename: []const u8) !Path {
|
||||||
return (try crtFilePath(&comp.crt_files, basename)) orelse {
|
return (try crtFilePath(&comp.crt_files, basename)) orelse {
|
||||||
const lci = comp.libc_installation orelse return error.LibCInstallationNotAvailable;
|
const lci = comp.libc_installation orelse return error.LibCInstallationNotAvailable;
|
||||||
const crt_dir_path = lci.crt_dir orelse return error.LibCInstallationMissingCrtDir;
|
const crt_dir_path = lci.crt_dir orelse return error.LibCInstallationMissingCrtDir;
|
||||||
|
|
|
||||||
|
|
@ -2724,7 +2724,7 @@ fn testRelocatableArchive(b: *Build, opts: Options) *Step {
|
||||||
fn testRelocatableEhFrame(b: *Build, opts: Options) *Step {
|
fn testRelocatableEhFrame(b: *Build, opts: Options) *Step {
|
||||||
const test_step = addTestStep(b, "relocatable-eh-frame", opts);
|
const test_step = addTestStep(b, "relocatable-eh-frame", opts);
|
||||||
|
|
||||||
const obj = addObject(b, opts, .{
|
const obj1 = addObject(b, opts, .{
|
||||||
.name = "obj1",
|
.name = "obj1",
|
||||||
.cpp_source_bytes =
|
.cpp_source_bytes =
|
||||||
\\#include <stdexcept>
|
\\#include <stdexcept>
|
||||||
|
|
@ -2733,12 +2733,21 @@ fn testRelocatableEhFrame(b: *Build, opts: Options) *Step {
|
||||||
\\}
|
\\}
|
||||||
,
|
,
|
||||||
});
|
});
|
||||||
addCppSourceBytes(obj,
|
obj1.linkLibCpp();
|
||||||
|
const obj2 = addObject(b, opts, .{
|
||||||
|
.name = "obj2",
|
||||||
|
.cpp_source_bytes =
|
||||||
\\extern int try_me();
|
\\extern int try_me();
|
||||||
\\int try_again() {
|
\\int try_again() {
|
||||||
\\ return try_me();
|
\\ return try_me();
|
||||||
\\}
|
\\}
|
||||||
, &.{});
|
,
|
||||||
|
});
|
||||||
|
obj2.linkLibCpp();
|
||||||
|
|
||||||
|
const obj = addObject(b, opts, .{ .name = "obj" });
|
||||||
|
obj.addObject(obj1);
|
||||||
|
obj.addObject(obj2);
|
||||||
obj.linkLibCpp();
|
obj.linkLibCpp();
|
||||||
|
|
||||||
const exe = addExecutable(b, opts, .{ .name = "test1" });
|
const exe = addExecutable(b, opts, .{ .name = "test1" });
|
||||||
|
|
@ -2768,8 +2777,8 @@ fn testRelocatableEhFrame(b: *Build, opts: Options) *Step {
|
||||||
fn testRelocatableEhFrameComdatHeavy(b: *Build, opts: Options) *Step {
|
fn testRelocatableEhFrameComdatHeavy(b: *Build, opts: Options) *Step {
|
||||||
const test_step = addTestStep(b, "relocatable-eh-frame-comdat-heavy", opts);
|
const test_step = addTestStep(b, "relocatable-eh-frame-comdat-heavy", opts);
|
||||||
|
|
||||||
const obj = addObject(b, opts, .{
|
const obj1 = addObject(b, opts, .{
|
||||||
.name = "obj2",
|
.name = "obj1",
|
||||||
.cpp_source_bytes =
|
.cpp_source_bytes =
|
||||||
\\#include <stdexcept>
|
\\#include <stdexcept>
|
||||||
\\int try_me() {
|
\\int try_me() {
|
||||||
|
|
@ -2777,13 +2786,20 @@ fn testRelocatableEhFrameComdatHeavy(b: *Build, opts: Options) *Step {
|
||||||
\\}
|
\\}
|
||||||
,
|
,
|
||||||
});
|
});
|
||||||
addCppSourceBytes(obj,
|
obj1.linkLibCpp();
|
||||||
|
const obj2 = addObject(b, opts, .{
|
||||||
|
.name = "obj2",
|
||||||
|
.cpp_source_bytes =
|
||||||
\\extern int try_me();
|
\\extern int try_me();
|
||||||
\\int try_again() {
|
\\int try_again() {
|
||||||
\\ return try_me();
|
\\ return try_me();
|
||||||
\\}
|
\\}
|
||||||
, &.{});
|
,
|
||||||
addCppSourceBytes(obj,
|
});
|
||||||
|
obj2.linkLibCpp();
|
||||||
|
const obj3 = addObject(b, opts, .{
|
||||||
|
.name = "obj3",
|
||||||
|
.cpp_source_bytes =
|
||||||
\\#include <iostream>
|
\\#include <iostream>
|
||||||
\\#include <stdexcept>
|
\\#include <stdexcept>
|
||||||
\\extern int try_again();
|
\\extern int try_again();
|
||||||
|
|
@ -2795,7 +2811,14 @@ fn testRelocatableEhFrameComdatHeavy(b: *Build, opts: Options) *Step {
|
||||||
\\ }
|
\\ }
|
||||||
\\ return 0;
|
\\ return 0;
|
||||||
\\}
|
\\}
|
||||||
, &.{});
|
,
|
||||||
|
});
|
||||||
|
obj3.linkLibCpp();
|
||||||
|
|
||||||
|
const obj = addObject(b, opts, .{ .name = "obj" });
|
||||||
|
obj.addObject(obj1);
|
||||||
|
obj.addObject(obj2);
|
||||||
|
obj.addObject(obj3);
|
||||||
obj.linkLibCpp();
|
obj.linkLibCpp();
|
||||||
|
|
||||||
const exe = addExecutable(b, opts, .{ .name = "test2" });
|
const exe = addExecutable(b, opts, .{ .name = "test2" });
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue