我想掃描組件文件,爲的DejaGnu:的DejaGnu掃描彙編正則表達式
ld.h%D2,
但我無法解釋點字符和數字字符。 我嘗試以下:(一個反斜槓,兩個反斜線和包圍)
/* { dg-final { scan-assembler-times "ld\.h\t%d\d," 1 { target { tricore-*-* } } } } */
/* { dg-final { scan-assembler-times "ld\\.h\t%d\\d," 1 { target { tricore-*-* } } } } */
/* { dg-final { scan-assembler-times "ld[.]h\t%d[0-9]," 1 { target { tricore-*-* } } } } */
- 殼體與一個反斜槓:它簡單地消失,所以正則表達式的含義改變。
- 用兩個反斜槓:它保留它們兩個,所以在掃描期間沒有匹配。
- 使用括號:出現錯誤。
輸出:
Running ../../../../testsuite/mytest/TX-1234.exp ...
PASS: testsuite/mytest/size16.c (test for excess errors)
FAIL: testsuite/mytest/size16.c scan-assembler-times \tld.h\t%dd, 1
FAIL: testsuite/mytest/size16.c scan-assembler-times \tld\\.h\t%d\\d, 1
ERROR: (DejaGnu) proc "." does not exist.
所以,我怎麼解釋\.
字符或\d
小數呢?
此表達式也失敗。 DejaGnu的解析器不是常規的RegEx解析器。 – Tannis