mirror of
https://github.com/ziglang/zig.git
synced 2025-12-06 14:23:09 +00:00
remove hard tabs from source code
these are illegal according to the spec
This commit is contained in:
parent
377e8579f9
commit
a7029496d1
@ -677,10 +677,10 @@ fn montReduce(x: i32) i16 {
|
|||||||
// Note gcd(2¹⁶, q) = 1 as q is prime. Write q' := 62209 = q⁻¹ mod R.
|
// Note gcd(2¹⁶, q) = 1 as q is prime. Write q' := 62209 = q⁻¹ mod R.
|
||||||
// First we compute
|
// First we compute
|
||||||
//
|
//
|
||||||
// m := ((x mod R) q') mod R
|
// m := ((x mod R) q') mod R
|
||||||
// = x q' mod R
|
// = x q' mod R
|
||||||
// = int16(x q')
|
// = int16(x q')
|
||||||
// = int16(int32(x) * int32(q'))
|
// = int16(int32(x) * int32(q'))
|
||||||
//
|
//
|
||||||
// Note that x q' might be as big as 2³² and could overflow the int32
|
// Note that x q' might be as big as 2³² and could overflow the int32
|
||||||
// multiplication in the last line. However for any int32s a and b,
|
// multiplication in the last line. However for any int32s a and b,
|
||||||
|
|||||||
@ -203,8 +203,7 @@ pub const symtab_command = extern struct {
|
|||||||
/// local symbols (static and debugging symbols) - grouped by module
|
/// local symbols (static and debugging symbols) - grouped by module
|
||||||
/// defined external symbols - grouped by module (sorted by name if not lib)
|
/// defined external symbols - grouped by module (sorted by name if not lib)
|
||||||
/// undefined external symbols (sorted by name if MH_BINDATLOAD is not set,
|
/// undefined external symbols (sorted by name if MH_BINDATLOAD is not set,
|
||||||
/// and in order the were seen by the static
|
/// and in order the were seen by the static linker if MH_BINDATLOAD is set)
|
||||||
/// linker if MH_BINDATLOAD is set)
|
|
||||||
/// In this load command there are offsets and counts to each of the three groups
|
/// In this load command there are offsets and counts to each of the three groups
|
||||||
/// of symbols.
|
/// of symbols.
|
||||||
///
|
///
|
||||||
@ -219,9 +218,9 @@ pub const symtab_command = extern struct {
|
|||||||
/// shared library. For executable and object modules, which are files
|
/// shared library. For executable and object modules, which are files
|
||||||
/// containing only one module, the information that would be in these three
|
/// containing only one module, the information that would be in these three
|
||||||
/// tables is determined as follows:
|
/// tables is determined as follows:
|
||||||
/// table of contents - the defined external symbols are sorted by name
|
/// table of contents - the defined external symbols are sorted by name
|
||||||
/// module table - the file contains only one module so everything in the
|
/// module table - the file contains only one module so everything in the file
|
||||||
/// file is part of the module.
|
/// is part of the module.
|
||||||
/// reference symbol table - is the defined and undefined external symbols
|
/// reference symbol table - is the defined and undefined external symbols
|
||||||
///
|
///
|
||||||
/// For dynamically linked shared library files this load command also contains
|
/// For dynamically linked shared library files this load command also contains
|
||||||
|
|||||||
@ -303,16 +303,16 @@ test "detect" {
|
|||||||
\\<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
\\<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
\\<plist version="1.0">
|
\\<plist version="1.0">
|
||||||
\\<dict>
|
\\<dict>
|
||||||
\\ <key>ProductBuildVersion</key>
|
\\ <key>ProductBuildVersion</key>
|
||||||
\\ <string>7W98</string>
|
\\ <string>7W98</string>
|
||||||
\\ <key>ProductCopyright</key>
|
\\ <key>ProductCopyright</key>
|
||||||
\\ <string>Apple Computer, Inc. 1983-2004</string>
|
\\ <string>Apple Computer, Inc. 1983-2004</string>
|
||||||
\\ <key>ProductName</key>
|
\\ <key>ProductName</key>
|
||||||
\\ <string>Mac OS X</string>
|
\\ <string>Mac OS X</string>
|
||||||
\\ <key>ProductUserVisibleVersion</key>
|
\\ <key>ProductUserVisibleVersion</key>
|
||||||
\\ <string>10.3.9</string>
|
\\ <string>10.3.9</string>
|
||||||
\\ <key>ProductVersion</key>
|
\\ <key>ProductVersion</key>
|
||||||
\\ <string>10.3.9</string>
|
\\ <string>10.3.9</string>
|
||||||
\\</dict>
|
\\</dict>
|
||||||
\\</plist>
|
\\</plist>
|
||||||
,
|
,
|
||||||
@ -323,18 +323,18 @@ test "detect" {
|
|||||||
\\<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
\\<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
\\<plist version="1.0">
|
\\<plist version="1.0">
|
||||||
\\<dict>
|
\\<dict>
|
||||||
\\ <key>ProductBuildVersion</key>
|
\\ <key>ProductBuildVersion</key>
|
||||||
\\ <string>19G68</string>
|
\\ <string>19G68</string>
|
||||||
\\ <key>ProductCopyright</key>
|
\\ <key>ProductCopyright</key>
|
||||||
\\ <string>1983-2020 Apple Inc.</string>
|
\\ <string>1983-2020 Apple Inc.</string>
|
||||||
\\ <key>ProductName</key>
|
\\ <key>ProductName</key>
|
||||||
\\ <string>Mac OS X</string>
|
\\ <string>Mac OS X</string>
|
||||||
\\ <key>ProductUserVisibleVersion</key>
|
\\ <key>ProductUserVisibleVersion</key>
|
||||||
\\ <string>10.15.6</string>
|
\\ <string>10.15.6</string>
|
||||||
\\ <key>ProductVersion</key>
|
\\ <key>ProductVersion</key>
|
||||||
\\ <string>10.15.6</string>
|
\\ <string>10.15.6</string>
|
||||||
\\ <key>iOSSupportVersion</key>
|
\\ <key>iOSSupportVersion</key>
|
||||||
\\ <string>13.6</string>
|
\\ <string>13.6</string>
|
||||||
\\</dict>
|
\\</dict>
|
||||||
\\</plist>
|
\\</plist>
|
||||||
,
|
,
|
||||||
@ -345,18 +345,18 @@ test "detect" {
|
|||||||
\\<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
\\<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
\\<plist version="1.0">
|
\\<plist version="1.0">
|
||||||
\\<dict>
|
\\<dict>
|
||||||
\\ <key>ProductBuildVersion</key>
|
\\ <key>ProductBuildVersion</key>
|
||||||
\\ <string>20A2408</string>
|
\\ <string>20A2408</string>
|
||||||
\\ <key>ProductCopyright</key>
|
\\ <key>ProductCopyright</key>
|
||||||
\\ <string>1983-2020 Apple Inc.</string>
|
\\ <string>1983-2020 Apple Inc.</string>
|
||||||
\\ <key>ProductName</key>
|
\\ <key>ProductName</key>
|
||||||
\\ <string>macOS</string>
|
\\ <string>macOS</string>
|
||||||
\\ <key>ProductUserVisibleVersion</key>
|
\\ <key>ProductUserVisibleVersion</key>
|
||||||
\\ <string>11.0</string>
|
\\ <string>11.0</string>
|
||||||
\\ <key>ProductVersion</key>
|
\\ <key>ProductVersion</key>
|
||||||
\\ <string>11.0</string>
|
\\ <string>11.0</string>
|
||||||
\\ <key>iOSSupportVersion</key>
|
\\ <key>iOSSupportVersion</key>
|
||||||
\\ <string>14.2</string>
|
\\ <string>14.2</string>
|
||||||
\\</dict>
|
\\</dict>
|
||||||
\\</plist>
|
\\</plist>
|
||||||
,
|
,
|
||||||
@ -367,18 +367,18 @@ test "detect" {
|
|||||||
\\<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
\\<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
\\<plist version="1.0">
|
\\<plist version="1.0">
|
||||||
\\<dict>
|
\\<dict>
|
||||||
\\ <key>ProductBuildVersion</key>
|
\\ <key>ProductBuildVersion</key>
|
||||||
\\ <string>20C63</string>
|
\\ <string>20C63</string>
|
||||||
\\ <key>ProductCopyright</key>
|
\\ <key>ProductCopyright</key>
|
||||||
\\ <string>1983-2020 Apple Inc.</string>
|
\\ <string>1983-2020 Apple Inc.</string>
|
||||||
\\ <key>ProductName</key>
|
\\ <key>ProductName</key>
|
||||||
\\ <string>macOS</string>
|
\\ <string>macOS</string>
|
||||||
\\ <key>ProductUserVisibleVersion</key>
|
\\ <key>ProductUserVisibleVersion</key>
|
||||||
\\ <string>11.1</string>
|
\\ <string>11.1</string>
|
||||||
\\ <key>ProductVersion</key>
|
\\ <key>ProductVersion</key>
|
||||||
\\ <string>11.1</string>
|
\\ <string>11.1</string>
|
||||||
\\ <key>iOSSupportVersion</key>
|
\\ <key>iOSSupportVersion</key>
|
||||||
\\ <string>14.3</string>
|
\\ <string>14.3</string>
|
||||||
\\</dict>
|
\\</dict>
|
||||||
\\</plist>
|
\\</plist>
|
||||||
,
|
,
|
||||||
|
|||||||
@ -109,12 +109,12 @@ const RiscvCpuinfoParser = CpuinfoParser(RiscvCpuinfoImpl);
|
|||||||
|
|
||||||
test "cpuinfo: RISC-V" {
|
test "cpuinfo: RISC-V" {
|
||||||
try testParser(RiscvCpuinfoParser, .riscv64, &Target.riscv.cpu.sifive_u74,
|
try testParser(RiscvCpuinfoParser, .riscv64, &Target.riscv.cpu.sifive_u74,
|
||||||
\\processor : 0
|
\\processor : 0
|
||||||
\\hart : 1
|
\\hart : 1
|
||||||
\\isa : rv64imafdc
|
\\isa : rv64imafdc
|
||||||
\\mmu : sv39
|
\\mmu : sv39
|
||||||
\\isa-ext :
|
\\isa-ext :
|
||||||
\\uarch : sifive,u74-mc
|
\\uarch : sifive,u74-mc
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -177,16 +177,16 @@ const PowerpcCpuinfoParser = CpuinfoParser(PowerpcCpuinfoImpl);
|
|||||||
|
|
||||||
test "cpuinfo: PowerPC" {
|
test "cpuinfo: PowerPC" {
|
||||||
try testParser(PowerpcCpuinfoParser, .powerpc, &Target.powerpc.cpu.@"970",
|
try testParser(PowerpcCpuinfoParser, .powerpc, &Target.powerpc.cpu.@"970",
|
||||||
\\processor : 0
|
\\processor : 0
|
||||||
\\cpu : PPC970MP, altivec supported
|
\\cpu : PPC970MP, altivec supported
|
||||||
\\clock : 1250.000000MHz
|
\\clock : 1250.000000MHz
|
||||||
\\revision : 1.1 (pvr 0044 0101)
|
\\revision : 1.1 (pvr 0044 0101)
|
||||||
);
|
);
|
||||||
try testParser(PowerpcCpuinfoParser, .powerpc64le, &Target.powerpc.cpu.pwr8,
|
try testParser(PowerpcCpuinfoParser, .powerpc64le, &Target.powerpc.cpu.pwr8,
|
||||||
\\processor : 0
|
\\processor : 0
|
||||||
\\cpu : POWER8 (raw), altivec supported
|
\\cpu : POWER8 (raw), altivec supported
|
||||||
\\clock : 2926.000000MHz
|
\\clock : 2926.000000MHz
|
||||||
\\revision : 2.0 (pvr 004d 0200)
|
\\revision : 2.0 (pvr 004d 0200)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -304,25 +304,25 @@ test "cpuinfo: ARM" {
|
|||||||
\\CPU revision : 7
|
\\CPU revision : 7
|
||||||
);
|
);
|
||||||
try testParser(ArmCpuinfoParser, .arm, &Target.arm.cpu.cortex_a7,
|
try testParser(ArmCpuinfoParser, .arm, &Target.arm.cpu.cortex_a7,
|
||||||
\\processor : 0
|
\\processor : 0
|
||||||
\\model name : ARMv7 Processor rev 3 (v7l)
|
\\model name : ARMv7 Processor rev 3 (v7l)
|
||||||
\\BogoMIPS : 18.00
|
\\BogoMIPS : 18.00
|
||||||
\\Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae
|
\\Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae
|
||||||
\\CPU implementer : 0x41
|
\\CPU implementer : 0x41
|
||||||
\\CPU architecture: 7
|
\\CPU architecture: 7
|
||||||
\\CPU variant : 0x0
|
\\CPU variant : 0x0
|
||||||
\\CPU part : 0xc07
|
\\CPU part : 0xc07
|
||||||
\\CPU revision : 3
|
\\CPU revision : 3
|
||||||
\\
|
\\
|
||||||
\\processor : 4
|
\\processor : 4
|
||||||
\\model name : ARMv7 Processor rev 3 (v7l)
|
\\model name : ARMv7 Processor rev 3 (v7l)
|
||||||
\\BogoMIPS : 90.00
|
\\BogoMIPS : 90.00
|
||||||
\\Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae
|
\\Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae
|
||||||
\\CPU implementer : 0x41
|
\\CPU implementer : 0x41
|
||||||
\\CPU architecture: 7
|
\\CPU architecture: 7
|
||||||
\\CPU variant : 0x2
|
\\CPU variant : 0x2
|
||||||
\\CPU part : 0xc0f
|
\\CPU part : 0xc0f
|
||||||
\\CPU revision : 3
|
\\CPU revision : 3
|
||||||
);
|
);
|
||||||
try testParser(ArmCpuinfoParser, .aarch64, &Target.aarch64.cpu.cortex_a72,
|
try testParser(ArmCpuinfoParser, .aarch64, &Target.aarch64.cpu.cortex_a72,
|
||||||
\\processor : 0
|
\\processor : 0
|
||||||
|
|||||||
@ -237,10 +237,7 @@ test "double quoted string" {
|
|||||||
try testing.expectEqualStrings(
|
try testing.expectEqualStrings(
|
||||||
\\"here" are some escaped quotes
|
\\"here" are some escaped quotes
|
||||||
, arr[1]);
|
, arr[1]);
|
||||||
try testing.expectEqualStrings(
|
try testing.expectEqualStrings("newlines and tabs\nare\tsupported", arr[2]);
|
||||||
\\newlines and tabs
|
|
||||||
\\are supported
|
|
||||||
, arr[2]);
|
|
||||||
try testing.expectEqualStrings(
|
try testing.expectEqualStrings(
|
||||||
\\let's have
|
\\let's have
|
||||||
\\some fun!
|
\\some fun!
|
||||||
|
|||||||
@ -26,17 +26,17 @@ pub fn addCases(cases: *tests.RunTranslatedCContext) void {
|
|||||||
\\void baz(void);
|
\\void baz(void);
|
||||||
\\struct foo { int x; };
|
\\struct foo { int x; };
|
||||||
\\void bar() {
|
\\void bar() {
|
||||||
\\ struct foo tmp;
|
\\ struct foo tmp;
|
||||||
\\}
|
\\}
|
||||||
\\
|
\\
|
||||||
\\void baz() {
|
\\void baz() {
|
||||||
\\ struct foo tmp;
|
\\ struct foo tmp;
|
||||||
\\}
|
\\}
|
||||||
\\
|
\\
|
||||||
\\int main(void) {
|
\\int main(void) {
|
||||||
\\ bar();
|
\\ bar();
|
||||||
\\ baz();
|
\\ baz();
|
||||||
\\ return 0;
|
\\ return 0;
|
||||||
\\}
|
\\}
|
||||||
, "");
|
, "");
|
||||||
|
|
||||||
@ -53,7 +53,7 @@ pub fn addCases(cases: *tests.RunTranslatedCContext) void {
|
|||||||
cases.add("parenthesized string literal",
|
cases.add("parenthesized string literal",
|
||||||
\\void foo(const char *s) {}
|
\\void foo(const char *s) {}
|
||||||
\\int main(void) {
|
\\int main(void) {
|
||||||
\\ foo(("bar"));
|
\\ foo(("bar"));
|
||||||
\\}
|
\\}
|
||||||
, "");
|
, "");
|
||||||
|
|
||||||
|
|||||||
@ -133,20 +133,20 @@ pub fn addCases(cases: *tests.TranslateCContext) void {
|
|||||||
|
|
||||||
cases.add("scoped typedef",
|
cases.add("scoped typedef",
|
||||||
\\void foo() {
|
\\void foo() {
|
||||||
\\ typedef union {
|
\\ typedef union {
|
||||||
\\ int A;
|
\\ int A;
|
||||||
\\ int B;
|
\\ int B;
|
||||||
\\ int C;
|
\\ int C;
|
||||||
\\ } Foo;
|
\\ } Foo;
|
||||||
\\ Foo a = {0};
|
\\ Foo a = {0};
|
||||||
\\ {
|
\\ {
|
||||||
\\ typedef union {
|
\\ typedef union {
|
||||||
\\ int A;
|
\\ int A;
|
||||||
\\ int B;
|
\\ int B;
|
||||||
\\ int C;
|
\\ int C;
|
||||||
\\ } Foo;
|
\\ } Foo;
|
||||||
\\ Foo a = {0};
|
\\ Foo a = {0};
|
||||||
\\ }
|
\\ }
|
||||||
\\}
|
\\}
|
||||||
, &[_][]const u8{
|
, &[_][]const u8{
|
||||||
\\pub export fn foo() void {
|
\\pub export fn foo() void {
|
||||||
@ -2043,18 +2043,18 @@ pub fn addCases(cases: *tests.TranslateCContext) void {
|
|||||||
\\ break;
|
\\ break;
|
||||||
\\ }
|
\\ }
|
||||||
\\ case 4:
|
\\ case 4:
|
||||||
\\ case 5:
|
\\ case 5:
|
||||||
\\ res = 69;
|
\\ res = 69;
|
||||||
\\ {
|
\\ {
|
||||||
\\ res = 5;
|
\\ res = 5;
|
||||||
\\ return;
|
\\ return;
|
||||||
\\ }
|
\\ }
|
||||||
\\ case 6:
|
\\ case 6:
|
||||||
\\ switch (res) {
|
\\ switch (res) {
|
||||||
\\ case 9: break;
|
\\ case 9: break;
|
||||||
\\ }
|
\\ }
|
||||||
\\ res = 1;
|
\\ res = 1;
|
||||||
\\ return;
|
\\ return;
|
||||||
\\ }
|
\\ }
|
||||||
\\}
|
\\}
|
||||||
, &[_][]const u8{
|
, &[_][]const u8{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user