about summary refs log tree commit diff stats
path: root/subx
diff options
context:
space:
mode:
Diffstat (limited to 'subx')
-rwxr-xr-xsubx/apps/surveybin41172 -> 41174 bytes
-rw-r--r--subx/apps/survey.subx10
-rwxr-xr-xsubx/test_apps10
3 files changed, 16 insertions, 4 deletions
diff --git a/subx/apps/survey b/subx/apps/survey
index ea50364a..6971e511 100755
--- a/subx/apps/survey
+++ b/subx/apps/survey
Binary files differdiff --git a/subx/apps/survey.subx b/subx/apps/survey.subx
index da01407b..bc96fe14 100644
--- a/subx/apps/survey.subx
+++ b/subx/apps/survey.subx
@@ -2753,11 +2753,13 @@ emit-elf-program-header-entry:  # out : (address buffered-file), curr-segment :
     # . if (EAX == 0) goto next check
     3d/compare-EAX-and  0/imm32
     74/jump-if-equal  $emit-elf-program-header-entry:data/disp8
-    # *Elf_p_flags = rw-
-    c7          0/subop/copy        0/mod/indirect  5/rm32/.disp32            .             .           .           Elf_p_flags/disp32  6/imm32       # copy to *Elf_p_flags
-$emit-elf-program-header-entry:data:
-    # otherwise *Elf_p_flags = r-x
+    # *Elf_p_flags = r-x
     c7          0/subop/copy        0/mod/indirect  5/rm32/.disp32            .             .           .           Elf_p_flags/disp32  5/imm32       # copy to *Elf_p_flags
+    eb/jump  $emit-elf-program-header-entry:really-emit/disp8
+$emit-elf-program-header-entry:data:
+    # otherwise *Elf_p_flags = rw-
+    c7          0/subop/copy        0/mod/indirect  5/rm32/.disp32            .             .           .           Elf_p_flags/disp32  6/imm32       # copy to *Elf_p_flags
+$emit-elf-program-header-entry:really-emit:
     # emit-hex-array(out, Elf_program_header_entry)
     # . . push args
     68/push  Elf_program_header_entry/imm32
diff --git a/subx/test_apps b/subx/test_apps
index 10b6869b..068712a7 100755
--- a/subx/test_apps
+++ b/subx/test_apps
@@ -10,6 +10,8 @@ test `uname` = 'Linux'  &&  echo 'testing native runs as well'
 
 CFLAGS=$CFLAGS ./build
 
+echo "== translating and running using C++"
+
 echo ex1
 ./subx translate examples/ex1.subx  -o examples/ex1
 [ "$1" != record ]  &&  git diff --exit-code examples/ex1
@@ -224,4 +226,12 @@ test `uname` = 'Linux'  &&  {
   echo
 }
 
+echo "== translating using SubX"
+
+echo ex1
+cat examples/ex1.subx |subx_bin run apps/dquotes |subx_bin run apps/assort |subx_bin run apps/pack |subx_bin run apps/survey |subx_bin run apps/hex |diff examples/ex1 -
+test `uname` = 'Linux'  &&  {
+  cat examples/ex1.subx |apps/dquotes |apps/assort |apps/pack |apps/survey |apps/hex |diff examples/ex1 -
+}
+
 exit 0