unittests: sync tests with changes of call instruction dump in LLVM

LLVM r340519 changes call instruction's dump to print addrspace
if it is not the module's default addrspace, or it cannot find
the module.

In our unit tests, there are two cases. Some tests check the
function's dump. In this case we do have a module, and addrspace
is not printed. Some tests checks a single statement or block. In
this case we have not yet attached the instructions to the
function, so the IR dumper cannot find a module, and thus print
addrspace. Add addrspace to the expected IR dump in this case.

While here, change BackEnd to Backend, for consistency.

Change-Id: I24b6c3b16c4af73159a87660ac7706a919525d93
Reviewed-on: https://go-review.googlesource.com/137755
Reviewed-by: Than McIntosh <thanm@google.com>
diff --git a/unittests/BackendCore/BackendArrayStruct.cpp b/unittests/BackendCore/BackendArrayStruct.cpp
index 7980ebf..4361d51 100644
--- a/unittests/BackendCore/BackendArrayStruct.cpp
+++ b/unittests/BackendCore/BackendArrayStruct.cpp
@@ -70,7 +70,7 @@
   const char *exp = R"RAW_RESULT(
       %cast.0 = bitcast { i8*, i32 }* %loc1 to i8*
       %cast.1 = bitcast { i8*, i32 }* @const.0 to i8*
-      call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 %cast.0, i8* align 8 %cast.1, i64 16, i1 false)
+      call addrspace(0) void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 %cast.0, i8* align 8 %cast.1, i64 16, i1 false)
       store { i8*, i32 }* %loc1, { i8*, i32 }** %loc2
       store i32 0, i32* %x
       %field.0 = getelementptr inbounds { i8*, i32 }, { i8*, i32 }* %loc1, i32 0, i32 1
@@ -295,10 +295,10 @@
   const char *exp = R"RAW_RESULT(
     %cast.0 = bitcast [4 x i64]* %aa to i8*
     %cast.1 = bitcast [4 x i64]* @const.0 to i8*
-    call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 %cast.0, i8* align 8 %cast.1, i64 32, i1 false)
+    call addrspace(0) void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 %cast.0, i8* align 8 %cast.1, i64 32, i1 false)
     %cast.2 = bitcast [4 x i64]* %ab to i8*
     %cast.3 = bitcast [4 x i64]* @const.1 to i8*
-    call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 %cast.2, i8* align 8 %cast.3, i64 32, i1 false)
+    call addrspace(0) void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 %cast.2, i8* align 8 %cast.3, i64 32, i1 false)
     store i64 0, i64* %z
     %z.ld.0 = load i64, i64* %z
     %index.0 = getelementptr [4 x i64], [4 x i64]* %ac, i32 0, i32 0
@@ -358,7 +358,7 @@
   const char *exp = R"RAW_RESULT(
       %cast.0 = bitcast { i32*, i32 }* %loc1 to i8*
       %cast.1 = bitcast { i32*, i32 }* @const.0 to i8*
-      call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 %cast.0, i8* align 8 %cast.1, i64 16, i1 false)
+      call addrspace(0) void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 %cast.0, i8* align 8 %cast.1, i64 16, i1 false)
       %field.0 = getelementptr inbounds { i32*, i32 }, { i32*, i32 }* %loc1, i32 0, i32 1
       %loc1.field.ld.0 = load i32, i32* %field.0
       %field.1 = getelementptr inbounds { i32*, i32 }, { i32*, i32 }* %loc2, i32 0, i32 0
@@ -416,7 +416,7 @@
   const char *exp = R"RAW_RESULT(
   %cast.0 = bitcast { { i32*, i32 }, float }* %loc1 to i8*
   %cast.1 = bitcast { { i32*, i32 }, float }* @const.0 to i8*
-  call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 %cast.0, i8* align 8 %cast.1, i64 24, i1 false)
+  call addrspace(0) void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 %cast.0, i8* align 8 %cast.1, i64 24, i1 false)
   %field.0 = getelementptr inbounds { i32*, i32 }, { i32*, i32 }* %tmp.0, i32 0, i32 0
   store i32* %param1.addr, i32** %field.0
   %field.1 = getelementptr inbounds { i32*, i32 }, { i32*, i32 }* %tmp.0, i32 0, i32 1
@@ -424,7 +424,7 @@
   %field.2 = getelementptr inbounds { { i32*, i32 }, float }, { { i32*, i32 }, float }* %loc1, i32 0, i32 0
   %cast.2 = bitcast { i32*, i32 }* %field.2 to i8*
   %cast.3 = bitcast { i32*, i32 }* %tmp.0 to i8*
-  call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 %cast.2, i8* align 8 %cast.3, i64 16, i1 false)
+  call addrspace(0) void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 %cast.2, i8* align 8 %cast.3, i64 16, i1 false)
   %field.3 = getelementptr inbounds { { i32*, i32 }, float }, { { i32*, i32 }, float }* %loc1, i32 0, i32 1
   store float 3.000000e+00, float* %field.3
   )RAW_RESULT";
@@ -573,7 +573,7 @@
   const char *exp = R"RAW_RESULT(
   %cast.0 = bitcast [4 x i64]* %aa to i8*
   %cast.1 = bitcast [4 x i64]* @const.0 to i8*
-  call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 %cast.0, i8* align 8 %cast.1, i64 32, i1 false)
+  call addrspace(0) void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 %cast.0, i8* align 8 %cast.1, i64 32, i1 false)
   %index.0 = getelementptr [4 x i64], [4 x i64]* %aa, i32 0, i32 1
   %aa.index.ld.0 = load i64, i64* %index.0
   %index.1 = getelementptr [4 x i64], [4 x i64]* %aa, i32 0, i64 %aa.index.ld.0
@@ -643,7 +643,7 @@
   const char *exp = R"RAW_RESULT(
       %cast.0 = bitcast [10 x { i8, [4 x { i64, i64 }*], i8 }*]* %t1 to i8*
       %cast.1 = bitcast [10 x { i8, [4 x { i64, i64 }*], i8 }*]* @const.0 to i8*
-      call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 %cast.0, i8* align 8 %cast.1, i64 80, i1 false)
+      call addrspace(0) void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 %cast.0, i8* align 8 %cast.1, i64 80, i1 false)
       %index.0 = getelementptr [10 x { i8, [4 x { i64, i64 }*], i8 }*], [10 x { i8, [4 x { i64, i64 }*], i8 }*]* %t1, i32 0, i32 7
       %t1.index.ld.0 = load { i8, [4 x { i64, i64 }*], i8 }*, { i8, [4 x { i64, i64 }*], i8 }** %index.0
       %field.0 = getelementptr inbounds { i8, [4 x { i64, i64 }*], i8 }, { i8, [4 x { i64, i64 }*], i8 }* %t1.index.ld.0, i32 0, i32 1
@@ -726,22 +726,22 @@
   const char *exp = R"RAW_RESULT(
 %cast.0 = bitcast { i8* }* %x1 to i8*
   %cast.1 = bitcast { i8* }* @const.0 to i8*
-  call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 %cast.0, i8* align 8 %cast.1, i64 8, i1 false)
+  call addrspace(0) void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 %cast.0, i8* align 8 %cast.1, i64 8, i1 false)
   %cast.2 = bitcast { i8* }* %y1 to i8*
   %cast.3 = bitcast { i8* }* @const.0 to i8*
-  call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 %cast.2, i8* align 8 %cast.3, i64 8, i1 false)
+  call addrspace(0) void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 %cast.2, i8* align 8 %cast.3, i64 8, i1 false)
   %cast.4 = bitcast { i64, i64, i64, i64, i64, i64 }* %x2 to i8*
   %cast.5 = bitcast { i64, i64, i64, i64, i64, i64 }* @const.1 to i8*
-  call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 %cast.4, i8* align 8 %cast.5, i64 48, i1 false)
+  call addrspace(0) void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 %cast.4, i8* align 8 %cast.5, i64 48, i1 false)
   %cast.6 = bitcast { i64, i64, i64, i64, i64, i64 }* %y2 to i8*
   %cast.7 = bitcast { i64, i64, i64, i64, i64, i64 }* @const.1 to i8*
-  call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 %cast.6, i8* align 8 %cast.7, i64 48, i1 false)
+  call addrspace(0) void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 %cast.6, i8* align 8 %cast.7, i64 48, i1 false)
   %cast.8 = bitcast { i8* }* %x1 to i8*
   %cast.9 = bitcast { i8* }* %y1 to i8*
-  call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 %cast.8, i8* align 8 %cast.9, i64 8, i1 false)
+  call addrspace(0) void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 %cast.8, i8* align 8 %cast.9, i64 8, i1 false)
   %cast.10 = bitcast { i64, i64, i64, i64, i64, i64 }* %x2 to i8*
   %cast.11 = bitcast { i64, i64, i64, i64, i64, i64 }* %y2 to i8*
-  call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 %cast.10, i8* align 8 %cast.11, i64 48, i1 false)
+  call addrspace(0) void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 %cast.10, i8* align 8 %cast.11, i64 48, i1 false)
    )RAW_RESULT";
 
   bool isOK = h.expectBlock(exp);
@@ -786,7 +786,7 @@
   const char *exp = R"RAW_RESULT(
     %cast.0 = bitcast { i32 }* %t1 to i8*
     %cast.1 = bitcast { i32 }* @const.0 to i8*
-    call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 4 %cast.0, i8* align 4 %cast.1, i64 4, i1 false)
+    call addrspace(0) void @llvm.memcpy.p0i8.p0i8.i64(i8* align 4 %cast.0, i8* align 4 %cast.1, i64 4, i1 false)
     %field.0 = getelementptr inbounds { i32 }, { i32 }* %t1, i32 0, i32 0
     store i32* %field.0, i32** %a1
     store i32* getelementptr inbounds ({ i32 }, { i32 }* @t2, i32 0, i32 0), i32** %a2
diff --git a/unittests/BackendCore/BackendCABIOracleTests.cpp b/unittests/BackendCore/BackendCABIOracleTests.cpp
index 889ab89..0c431b6 100644
--- a/unittests/BackendCore/BackendCABIOracleTests.cpp
+++ b/unittests/BackendCore/BackendCABIOracleTests.cpp
@@ -328,7 +328,7 @@
   %ld.3 = load double, double* %field0.1
   %field1.1 = getelementptr inbounds { double, <2 x float> }, { double, <2 x float> }* %cast.2, i32 0, i32 1
   %ld.4 = load <2 x float>, <2 x float>* %field1.1
-  %call.0 = call { double, <2 x float> } @foo(i8* nest undef, <2 x float> %ld.1, i48 %ld.2, double %ld.3, <2 x float> %ld.4, i8 zeroext %sub.0, i8 signext %p4.ld.0, { { float, float, i16, i16, i16 }, { double, float, float } }* byval %p5)
+  %call.0 = call addrspace(0) { double, <2 x float> } @foo(i8* nest undef, <2 x float> %ld.1, i48 %ld.2, double %ld.3, <2 x float> %ld.4, i8 zeroext %sub.0, i8 signext %p4.ld.0, { { float, float, i16, i16, i16 }, { double, float, float } }* byval %p5)
   %cast.3 = bitcast { double, float, float }* %sret.actual.0 to { double, <2 x float> }*
   store { double, <2 x float> } %call.0, { double, <2 x float> }* %cast.3
   %cast.4 = bitcast { double, float, float }* %sret.actual.0 to { double, <2 x float> }*
@@ -380,10 +380,10 @@
   const char *exp = R"RAW_RESULT(
     %cast.0 = bitcast [2 x float]* %p0.addr to <2 x float>*
     %ld.0 = load <2 x float>, <2 x float>* %cast.0
-    call void @foo([3 x double]* sret %sret.actual.0, i8* nest undef, <2 x float> %ld.0)
+    call addrspace(0) void @foo([3 x double]* sret %sret.actual.0, i8* nest undef, <2 x float> %ld.0)
     %cast.1 = bitcast [3 x double]* %sret.formal.0 to i8*
     %cast.2 = bitcast [3 x double]* %sret.actual.0 to i8*
-    call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 %cast.1, i8* align 8 %cast.2, i64 24, i1 false)
+    call addrspace(0) void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 %cast.1, i8* align 8 %cast.2, i64 24, i1 false)
     ret void
     )RAW_RESULT";
 
@@ -430,7 +430,7 @@
   h.mkReturn(rvals);
 
   const char *exp = R"RAW_RESULT(
-     call void @foo(i8* nest undef, i32 4)
+     call addrspace(0) void @foo(i8* nest undef, i32 4)
      ret void
     )RAW_RESULT";
 
@@ -455,7 +455,7 @@
   h.mkExprStmt(be->call_expression(func, fn, args, nullptr, h.loc()));
 
   const char *exp = R"RAW_RESULT(
-     call void @llvm.trap()
+     call addrspace(0) void @llvm.trap()
     )RAW_RESULT";
 
   bool isOK = h.expectBlock(exp);
@@ -517,16 +517,16 @@
     %ld.1 = load double, double* %field0.0
     %field1.0 = getelementptr inbounds { double, double }, { double, double }* %p1.addr, i32 0, i32 1
     %ld.2 = load double, double* %field1.0
-    %call.0 = call <2 x float> @foo(i8* nest undef, <2 x float> %ld.0, double %ld.1, double %ld.2)
+    %call.0 = call addrspace(0) <2 x float> @foo(i8* nest undef, <2 x float> %ld.0, double %ld.1, double %ld.2)
     %cast.2 = bitcast { float, float }* %sret.actual.0 to <2 x float>*
     store <2 x float> %call.0, <2 x float>* %cast.2
     %cast.3 = bitcast { float, float }* %z to i8*
     %cast.4 = bitcast { float, float }* %sret.actual.0 to i8*
-    call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 4 %cast.3, i8* align 4 %cast.4, i64 8, i1 false)
+    call addrspace(0) void @llvm.memcpy.p0i8.p0i8.i64(i8* align 4 %cast.3, i8* align 4 %cast.4, i64 8, i1 false)
     %ld.3 = load <2 x float>, <2 x float>* bitcast ({ float, float }* @const.0 to <2 x float>*)
     %ld.4 = load double, double* getelementptr inbounds ({ double, double }, { double, double }* @const.1, i32 0, i32 0)
     %ld.5 = load double, double* getelementptr inbounds ({ double, double }, { double, double }* @const.1, i32 0, i32 1)
-    %call.1 = call <2 x float> @foo(i8* nest undef, <2 x float> %ld.3, double %ld.4, double %ld.5)
+    %call.1 = call addrspace(0) <2 x float> @foo(i8* nest undef, <2 x float> %ld.3, double %ld.4, double %ld.5)
     %cast.7 = bitcast { float, float }* %sret.actual.1 to <2 x float>*
     store <2 x float> %call.1, <2 x float>* %cast.7
     %cast.8 = bitcast { float, float }* %sret.actual.1 to <2 x float>*
diff --git a/unittests/BackendCore/BackendCallTests.cpp b/unittests/BackendCore/BackendCallTests.cpp
index 553b7cf..687dde1 100644
--- a/unittests/BackendCore/BackendCallTests.cpp
+++ b/unittests/BackendCore/BackendCallTests.cpp
@@ -36,7 +36,7 @@
   h.mkReturn(be->var_expression(x, loc));
 
   const char *exp = R"RAW_RESULT(
-      %call.0 = call i64 @foo(i8* nest undef, i32 3, i32 6, i64* null)
+      %call.0 = call addrspace(0) i64 @foo(i8* nest undef, i32 3, i32 6, i64* null)
       store i64 %call.0, i64* %x
       %x.ld.0 = load i64, i64* %x
       ret i64 %x.ld.0
@@ -72,7 +72,7 @@
   h.mkExprStmt(call);
 
   const char *exp = R"RAW_RESULT(
-     call void @bar(i8* nest undef)
+     call addrspace(0) void @bar(i8* nest undef)
     )RAW_RESULT";
 
   bool isOK = h.expectBlock(exp);
@@ -113,7 +113,7 @@
     const char *exp = R"RAW_RESULT(
      %cast.0 = bitcast { i8*, i32*, i64*, i64 }* %sret.formal.0 to i8*
      %cast.1 = bitcast { i8*, i32*, i64*, i64 }* @const.0 to i8*
-     call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 %cast.0, i8* align 8 %cast.1, i64 32, i1 false)
+     call addrspace(0) void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 %cast.0, i8* align 8 %cast.1, i64 32, i1 false)
      ret void
     )RAW_RESULT";
 
@@ -147,7 +147,7 @@
   store i64 101, i64* %field.3
   %cast.3 = bitcast { i8*, i32*, i64*, i64 }* %sret.formal.0 to i8*
   %cast.4 = bitcast { i8*, i32*, i64*, i64 }* %tmp.0 to i8*
-  call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 %cast.3, i8* align 8 %cast.4, i64 32, i1 false)
+  call addrspace(0) void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 %cast.3, i8* align 8 %cast.4, i64 32, i1 false)
   ret void
     )RAW_RESULT";
 
diff --git a/unittests/BackendCore/BackendExprTests.cpp b/unittests/BackendCore/BackendExprTests.cpp
index 730ec00..de82e34 100644
--- a/unittests/BackendCore/BackendExprTests.cpp
+++ b/unittests/BackendCore/BackendExprTests.cpp
@@ -1254,7 +1254,7 @@
     store double 0.000000e+00, double* %b
     %cast.0 = bitcast { double, double }* %x to i8*
     %cast.1 = bitcast { double, double }* @const.0 to i8*
-    call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 %cast.0, i8* align 8 %cast.1, i64 16, i1 false)
+    call addrspace(0) void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 %cast.0, i8* align 8 %cast.1, i64 16, i1 false)
     %field.0 = getelementptr inbounds { double, double }, { double, double }* %x, i32 0, i32 0
     %x.real.ld.0 = load double, double* %field.0
     store double %x.real.ld.0, double* %a
@@ -1670,7 +1670,7 @@
   h.mkExprStmt(call1);
 
   const char *exp = R"RAW_RESULT(
-     call void @foo(i8* nest undef, i8* null, i32* null, i64* null)
+     call addrspace(0) void @foo(i8* nest undef, i8* null, i32* null, i64* null)
     )RAW_RESULT";
 
   // Note that this
diff --git a/unittests/BackendCore/BackendFcnTests.cpp b/unittests/BackendCore/BackendFcnTests.cpp
index 160f0ea..dc76909 100644
--- a/unittests/BackendCore/BackendFcnTests.cpp
+++ b/unittests/BackendCore/BackendFcnTests.cpp
@@ -286,7 +286,7 @@
   const char *exp = R"RAW_RESULT(
     store i64 0, i64* %x
     %x.ld.0 = load i64, i64* %x
-    %call.0 = call i64 @llvm.cttz.i64(i64 %x.ld.0, i1 true)
+    %call.0 = call addrspace(0) i64 @llvm.cttz.i64(i64 %x.ld.0, i1 true)
   )RAW_RESULT";
 
   bool isOK = h.expectBlock(exp);
@@ -355,13 +355,13 @@
   store i64 10101, i64* %y
   %cast.0 = bitcast i64* %x to i8*
   %cast.1 = bitcast i64* %y to i8*
-  %call.0 = call i32 @memcmp(i8* %cast.0, i8* %cast.1, i64 8)
+  %call.0 = call addrspace(0) i32 @memcmp(i8* %cast.0, i8* %cast.1, i64 8)
   %cast.2 = bitcast i64* %x to i8*
   %cast.3 = bitcast i64* %y to i8*
-  call void @llvm.memmove.p0i8.p0i8.i64(i8* %cast.2, i8* %cast.3, i64 8, i1 false)
+  call addrspace(0) void @llvm.memmove.p0i8.p0i8.i64(i8* %cast.2, i8* %cast.3, i64 8, i1 false)
   %cast.4 = bitcast i64* %y to i8*
   %cast.5 = bitcast i64* %x to i8*
-  call void @llvm.memcpy.p0i8.p0i8.i64(i8* %cast.4, i8* %cast.5, i64 8, i1 false)
+  call addrspace(0) void @llvm.memcpy.p0i8.p0i8.i64(i8* %cast.4, i8* %cast.5, i64 8, i1 false)
   )RAW_RESULT";
 
   bool isOK = h.expectBlock(exp);
@@ -418,9 +418,9 @@
   h.mkLocal("y", bi32t, call32);
 
   const char *exp = R"RAW_RESULT(
-     %call.0 = call i64 @syscall(i8* nest undef, i64 64)
+     %call.0 = call addrspace(0) i64 @syscall(i8* nest undef, i64 64)
      store i64 %call.0, i64* %x
-     %call.1 = call i32 bitcast (i64 (i8*, i64)*
+     %call.1 = call addrspace(0) i32 bitcast (i64 (i8*, i64)*
            @syscall to i32 (i8*, i32)*)(i8* nest undef, i32 32)
      store i32 %call.1, i32* %y
   )RAW_RESULT";
@@ -499,13 +499,13 @@
   h.mkLocal("y", bps1t, call4);
 
   const char *exp = R"RAW_RESULT(
-    %call.0 = call i32 @bar(i8* nest undef)
+    %call.0 = call addrspace(0) i32 @bar(i8* nest undef)
     store i32 %call.0, i32* %a
-    %call.1 = call i32 @bar(i8* nest undef)
+    %call.1 = call addrspace(0) i32 @bar(i8* nest undef)
     store i32 %call.1, i32* %b
-    %call.2 = call {}* bitcast ({ i32 }* (i8*)* @baz to {}* (i8*)*)(i8* nest undef)
+    %call.2 = call addrspace(0) {}* bitcast ({ i32 }* (i8*)* @baz to {}* (i8*)*)(i8* nest undef)
     store {}* %call.2, {}** %x
-    %call.3 = call { i32 }* @baz(i8* nest undef)
+    %call.3 = call addrspace(0) { i32 }* @baz(i8* nest undef)
     store { i32 }* %call.3, { i32 }** %y
   )RAW_RESULT";
 
diff --git a/unittests/BackendCore/BackendPointerExprTests.cpp b/unittests/BackendCore/BackendPointerExprTests.cpp
index 285dc42..70da0e8 100644
--- a/unittests/BackendCore/BackendPointerExprTests.cpp
+++ b/unittests/BackendCore/BackendPointerExprTests.cpp
@@ -17,7 +17,7 @@
 
 namespace {
 
-TEST(BackEndPointerExprTests, TestAddrAndIndirection) {
+TEST(BackendPointerExprTests, TestAddrAndIndirection) {
   FcnTestHarness h("foo");
   Llvm_backend *be = h.be();
   Bfunction *func = h.func();
@@ -77,7 +77,7 @@
   EXPECT_FALSE(broken && "Module failed to verify.");
 }
 
-TEST(BackEndPointerExprTests, CreateFunctionCodeExpression) {
+TEST(BackendPointerExprTests, CreateFunctionCodeExpression) {
 
   FcnTestHarness h("foo");
   Llvm_backend *be = h.be();
@@ -120,7 +120,7 @@
   const char *exp = R"RAW_RESULT(
   %cast.0 = bitcast { i64 }* %fdloc1 to i8*
   %cast.1 = bitcast { i64 }* @const.0 to i8*
-  call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 %cast.0, i8* align 8 %cast.1, i64 8, i1 false)
+  call addrspace(0) void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 %cast.0, i8* align 8 %cast.1, i64 8, i1 false)
   store { i64 }* %fdloc1, { i64 }** %fploc1
   store { i64 (i8*, i32, i32, i64*)* }* null, { i64 (i8*, i32, i32, i64*)* }** %fploc2
   %fploc1.ld.0 = load { i64 }*, { i64 }** %fploc1
@@ -138,7 +138,7 @@
   EXPECT_FALSE(broken && "Module failed to verify.");
 }
 
-TEST(BackEndPointerExprTests, CreateNilPointerExpression) {
+TEST(BackendPointerExprTests, CreateNilPointerExpression) {
 
   FcnTestHarness h("foo");
   Llvm_backend *be = h.be();
@@ -196,7 +196,7 @@
   EXPECT_FALSE(broken && "Module failed to verify.");
 }
 
-TEST(BackEndPointerExprTests, TestDerefNilPointer) {
+TEST(BackendPointerExprTests, TestDerefNilPointer) {
   FcnTestHarness h("foo");
   Llvm_backend *be = h.be();
   Location loc;
@@ -217,7 +217,7 @@
     store i32 %deref.ld.0, i32* %x
     %cast.2 = bitcast { i32, i32 }* %y to i8*
     %cast.3 = bitcast { i32, i32 }* null to i8*
-    call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 4 %cast.2, i8* align 4 %cast.3, i64 8, i1 false)
+    call addrspace(0) void @llvm.memcpy.p0i8.p0i8.i64(i8* align 4 %cast.2, i8* align 4 %cast.3, i64 8, i1 false)
   )RAW_RESULT";
 
   bool isOK = h.expectBlock(exp);
@@ -227,7 +227,7 @@
   EXPECT_FALSE(broken && "Module failed to verify.");
 }
 
-TEST(BackEndPointerExprTests, CircularPointerExpressions1) {
+TEST(BackendPointerExprTests, CircularPointerExpressions1) {
 
   // This testpoint is intended to verify handling of expressions
   // involving circular pointer types. Go code:
@@ -351,7 +351,7 @@
   EXPECT_FALSE(broken && "Module failed to verify.");
 }
 
-TEST(BackEndPointerExprTests, CircularPointerExpressions2) {
+TEST(BackendPointerExprTests, CircularPointerExpressions2) {
 
   // More tests for circular pointers, this time
   // with multiple levels. Go code:
@@ -432,7 +432,7 @@
   EXPECT_FALSE(broken && "Module failed to verify.");
 }
 
-TEST(BackEndPointerExprTests, CreatePointerOffsetExprs) {
+TEST(BackendPointerExprTests, CreatePointerOffsetExprs) {
 
   FcnTestHarness h("foo");
   Llvm_backend *be = h.be();
@@ -483,7 +483,7 @@
   EXPECT_FALSE(broken && "Module failed to verify.");
 }
 
-TEST(BackEndPointerExprTests, TestAddrDerefFold) {
+TEST(BackendPointerExprTests, TestAddrDerefFold) {
 
   FcnTestHarness h("foo");
   Llvm_backend *be = h.be();
@@ -516,7 +516,7 @@
   EXPECT_FALSE(broken && "Module failed to verify.");
 }
 
-TEST(BackEndPointerExprTests, TestDerefPointerConstantLHS)
+TEST(BackendPointerExprTests, TestDerefPointerConstantLHS)
 {
   FcnTestHarness h("foo");
   Llvm_backend *be = h.be();
@@ -570,7 +570,7 @@
   EXPECT_FALSE(broken && "Module failed to verify.");
 }
 
-TEST(BackEndPointerExprTests, TestCircularFunctionTypes)
+TEST(BackendPointerExprTests, TestCircularFunctionTypes)
 {
   // Make sure we can handle circular function types, especially
   // those in which the cycle extends across multiple types. Example: