| ... | ... | @@ -2724,7 +2724,7 @@ fn testRelocatableArchive(b: *Build, opts: Options) *Step { |
| 2724 | 2724 | fn testRelocatableEhFrame(b: *Build, opts: Options) *Step { |
| 2725 | 2725 | const test_step = addTestStep(b, "relocatable-eh-frame", opts); |
| 2726 | 2726 | |
| 2727 | | const obj = addObject(b, opts, .{ |
| 2727 | const obj1 = addObject(b, opts, .{ |
| 2728 | 2728 | .name = "obj1", |
| 2729 | 2729 | .cpp_source_bytes = |
| 2730 | 2730 | \\#include <stdexcept> |
| ... | ... | @@ -2733,12 +2733,21 @@ fn testRelocatableEhFrame(b: *Build, opts: Options) *Step { |
| 2733 | 2733 | \\} |
| 2734 | 2734 | , |
| 2735 | 2735 | }); |
| 2736 | | addCppSourceBytes(obj, |
| 2736 | obj1.linkLibCpp(); |
| 2737 | const obj2 = addObject(b, opts, .{ |
| 2738 | .name = "obj2", |
| 2739 | .cpp_source_bytes = |
| 2737 | 2740 | \\extern int try_me(); |
| 2738 | 2741 | \\int try_again() { |
| 2739 | 2742 | \\ return try_me(); |
| 2740 | 2743 | \\} |
| 2741 | | , &.{}); |
| 2744 | , |
| 2745 | }); |
| 2746 | obj2.linkLibCpp(); |
| 2747 | |
| 2748 | const obj = addObject(b, opts, .{ .name = "obj" }); |
| 2749 | obj.addObject(obj1); |
| 2750 | obj.addObject(obj2); |
| 2742 | 2751 | obj.linkLibCpp(); |
| 2743 | 2752 | |
| 2744 | 2753 | const exe = addExecutable(b, opts, .{ .name = "test1" }); |
| ... | ... | @@ -2768,8 +2777,8 @@ fn testRelocatableEhFrame(b: *Build, opts: Options) *Step { |
| 2768 | 2777 | fn testRelocatableEhFrameComdatHeavy(b: *Build, opts: Options) *Step { |
| 2769 | 2778 | const test_step = addTestStep(b, "relocatable-eh-frame-comdat-heavy", opts); |
| 2770 | 2779 | |
| 2771 | | const obj = addObject(b, opts, .{ |
| 2772 | | .name = "obj2", |
| 2780 | const obj1 = addObject(b, opts, .{ |
| 2781 | .name = "obj1", |
| 2773 | 2782 | .cpp_source_bytes = |
| 2774 | 2783 | \\#include <stdexcept> |
| 2775 | 2784 | \\int try_me() { |
| ... | ... | @@ -2777,13 +2786,20 @@ fn testRelocatableEhFrameComdatHeavy(b: *Build, opts: Options) *Step { |
| 2777 | 2786 | \\} |
| 2778 | 2787 | , |
| 2779 | 2788 | }); |
| 2780 | | addCppSourceBytes(obj, |
| 2789 | obj1.linkLibCpp(); |
| 2790 | const obj2 = addObject(b, opts, .{ |
| 2791 | .name = "obj2", |
| 2792 | .cpp_source_bytes = |
| 2781 | 2793 | \\extern int try_me(); |
| 2782 | 2794 | \\int try_again() { |
| 2783 | 2795 | \\ return try_me(); |
| 2784 | 2796 | \\} |
| 2785 | | , &.{}); |
| 2786 | | addCppSourceBytes(obj, |
| 2797 | , |
| 2798 | }); |
| 2799 | obj2.linkLibCpp(); |
| 2800 | const obj3 = addObject(b, opts, .{ |
| 2801 | .name = "obj3", |
| 2802 | .cpp_source_bytes = |
| 2787 | 2803 | \\#include <iostream> |
| 2788 | 2804 | \\#include <stdexcept> |
| 2789 | 2805 | \\extern int try_again(); |
| ... | ... | @@ -2795,7 +2811,14 @@ fn testRelocatableEhFrameComdatHeavy(b: *Build, opts: Options) *Step { |
| 2795 | 2811 | \\ } |
| 2796 | 2812 | \\ return 0; |
| 2797 | 2813 | \\} |
| 2798 | | , &.{}); |
| 2814 | , |
| 2815 | }); |
| 2816 | obj3.linkLibCpp(); |
| 2817 | |
| 2818 | const obj = addObject(b, opts, .{ .name = "obj" }); |
| 2819 | obj.addObject(obj1); |
| 2820 | obj.addObject(obj2); |
| 2821 | obj.addObject(obj3); |
| 2799 | 2822 | obj.linkLibCpp(); |
| 2800 | 2823 | |
| 2801 | 2824 | const exe = addExecutable(b, opts, .{ .name = "test2" }); |