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