Skip to content

Commit ed11bd7

Browse files
jgarzikclaude
andcommitted
cc: Fix macOS aarch64 CI test failures
Gate RIP-relative addressing test to x86_64 only, and replace system header includes with minimal forward declarations in compound literal test to avoid platform-specific header parse failures. Co-Authored-By: Claude Opus 4.6 <[email protected]>
1 parent 15b71bd commit ed11bd7

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

cc/tests/codegen/misc.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@ int main() {
211211

212212
/// Test that non-PIE code uses direct RIP-relative addressing for globals.
213213
/// With -fno-pie, local globals should use foo(%rip) not GOT.
214+
#[cfg(target_arch = "x86_64")]
214215
#[test]
215216
fn codegen_global_accesses_use_rip_relative() {
216217
let c_file = create_c_file(
@@ -950,9 +951,11 @@ int main(void) {
950951
#[test]
951952
fn codegen_compound_literal_zero_init() {
952953
let code = r#"
953-
#include <stdio.h>
954-
#include <stdlib.h>
955-
#include <stdint.h>
954+
typedef long int64_t;
955+
void *malloc(unsigned long);
956+
void free(void *);
957+
int printf(const char *, ...);
958+
#define NULL ((void*)0)
956959
957960
typedef int (*func_ptr)(void);
958961

0 commit comments

Comments
 (0)